Part Number Hot Search : 
B2010 HC174 PRR10201 WR300 48S3P SI7446DP HE83006 H810KDZB
Product Description
Full Text Search
 

To Download DSPIC33EP128MC504 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? 2011-2013 microchip technology inc. ds70657g-page 1 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x operating conditions ? 3.0v to 3.6v, -40oc to +85oc, dc to 70 mips ? 3.0v to 3.6v, -40oc to +125oc, dc to 60 mips core: 16-bit dspic33e/pic24e cpu ? code efficient (c and assembly) architecture ? two 40-bit wide accumulators ? single-cycle (mac/mpy) with dual data fetch ? single-cycle mixed-sign mul plus hardware divide ? 32-bit multiply support clock management ? 1.0% internal oscillator ? programmable plls and oscillator clock sources ? fail-safe clock monitor (fscm) ? independent watchdog timer (wdt) ? fast wake-up and start-up power management ? low-power management modes (sleep, idle, doze) ? integrated power-on reset and brown-out reset ? 0.6 ma/mhz dynamic current (typical) ?30 a i pd current (typical) high-speed pwm ? up to three pwm pairs with independent timing ? dead time for rising and falling edges ? 7.14 ns pwm resolution ? pwm support for: - dc/dc, ac/dc, inverters, pfc, lighting - bldc, pmsm, acim, srm ? programmable fault inputs ? flexible trigger configurations for adc conversions advanced analog features ? adc module: - configurable as 10-bit, 1.1 msps with four s&h or 12-bit, 500 ksps with one s&h - six analog inputs on 28-pin devices and up to 16 analog inputs on 64-pin devices ? flexible and independent adc trigger sources ? up to three op amp/comparators with direct connection to the adc module: - additional dedicated comparator - programmable references with 32 voltage points ? charge time measurement unit (ctmu): - supports mtouch? capacitive touch sensing - provides high-resolution time measurement (1 ns) - on-chip temperature measurement timers/output compare/input capture ? 12 general purpose timers: - five 16-bit and up to two 32-bit timers/counters - four oc modules, configurable as timers/counters - ptg module with two configurable timers/counters - 32-bit quadrature encoder interface (qei) module, configurable as a timer/counter ? four ic modules ? peripheral pin select (pps) to allow function remap ? peripheral trigger generator (ptg) for scheduling complex sequences communication interfaces ? two uart modules (17.5 mbps) - with support for lin/j2602 protocols and irda ? ? two 4-wire spi modules (15 mbps) ? ecan? module (1 mbaud) can 2.0b support ?two i 2 c? modules (up to 1 mbaud) with smbus support ? pps to allow function remap ? programmable cyclic redundancy check (crc) direct memory access (dma) ? 4-channel dma with user-selectable priority arbitration ? uart, spi, adc, ecan, ic, oc and timers input/output ? sink/source 12 ma or 6 ma, pin-specific for standard v oh /v ol , up to 22 or 14 ma, respectively for non-standard v oh 1 ? 5v tolerant pins ? selectable open-drain, pull-ups and pull-downs ? up to 5 ma overvoltage clamp current ? external interrupts on all i/o pins qualification and class b support ? aec-q100 revg (grade 1, -40oc to +125oc) planned ? aec-q100 revg (grade 0, -40oc to +150oc) planned ? class b safety library, iec 60730 debugger development support ? in-circuit and in-application programming ? two program and two complex data breakpoints ? ieee 1149.2 compatible (jtag) boundary scan ? trace and run-time watch 16-bit microcontrollers and digital signal controllers with high-speed pwm, op amps and advanced analog
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 2 ? 2011-2013 microchip technology inc. dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x product families the device names, pin counts, memory sizes and peripheral availability of each device are listed in table 1 (general purpose families) and table 2 (motor control families). their pinout diagrams appear on the following pages. table 1: dspic33epxxxgp50x and pic24epxxxgp20x general purpose families device page erase size (instructions) program flash memory (kbytes) ram (kbyte) remappable peripherals i 2 c? crc generator 10-bit/12-bit adc (channels) op amps/comparators ctmu ptg i/o pins pins packages 16-bit/32-bit timers input capture output compare uart spi ( 2 ) ecan? technology external interrupts ( 3 ) pic24ep32gp202 512 32 4 54422?32162/3 ( 1 ) yes yes 21 28 spdip, soic, ssop ( 4 ) , qfn-s pic24ep64gp202 1024 64 8 pic24ep128gp202 1024 128 16 pic24ep256gp202 1024 256 32 pic24ep512gp202 1024 512 48 pic24ep32gp203 512 32 4 54422?32183/4yesyes2536vtla pic24ep64gp203 1024 64 8 pic24ep32gp204 512 32 4 54422?32193/4yesyes3544 vtla ( 4 ) , tqfp, qfn pic24ep64gp204 1024 64 8 pic24ep128gp204 1024 128 16 pic24ep256gp204 1024 256 32 pic24ep512gp204 1024 512 48 pic24ep64gp206 1024 64 8 54422?321163/4yesyes5364 tqfp, qfn pic24ep128gp206 1024 128 16 pic24ep256gp206 1024 256 32 pic24ep512gp206 1024 512 48 dspic33ep32gp502 512 32 4 54422132162/3 ( 1 ) yes yes 21 28 spdip, soic, ssop ( 4 ) , qfn-s dspic33ep64gp502 1024 64 8 dspic33ep128gp502 1024 128 16 dspic33ep256gp502 1024 256 32 dspic33ep512gp502 1024 512 48 dspic33ep32gp503 512 32 4 54422132183/4yesyes2536vtla dspic33ep64gp503 1024 64 8 dspic33ep32gp504 512 32 4 54422132193/4yesyes3544 vtla ( 4 ) , tqfp, qfn dspic33ep64gp504 1024 64 8 dspic33ep128gp504 1024 128 16 dspic33ep256gp504 1024 256 32 dspic33ep512gp504 1024 512 48 dspic33ep64gp506 1024 64 8 544221321163/4yesyes5364 tqfp, qfn dspic33ep128gp506 1024 128 16 dspic33ep256gp506 1024 256 32 dspic33ep512gp506 1024 512 48 note 1: on 28-pin devices, comparator 4 does not have external connections. refer to section 25.0 ?op amp/comparator module? for details. 2: only spi2 is remappable. 3: int0 is not remappable. 4: the ssop and vtla packages are not available for devices with 512 kbytes of memory.
? 2011-2013 microchip technology inc. ds70657g-page 3 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 2: dspic33epxxxmc20x/50x and pic24epxxxmc20x motor control families device page erase size (instructions) program flash memory (kbytes) ram (kbytes) remappable peripherals i 2 c? crc generator 10-bit/12-bit adc (channels) op amps/comparators ctmu ptg i/o pins pins packages 16-bit/32-bit timers input capture output compare motor control pwm ( 4 ) (channels) quadrature encoder interface uart spi ( 2 ) ecan? technology external interrupts ( 3 ) pic24ep32mc202 512 32 4 544 6 122?32162/3 ( 1 ) yes yes 21 28 spdip, soic, ssop ( 5 ) , qfn-s pic24ep64mc202 1024 64 8 pic24ep128mc202 1024 128 16 pic24ep256mc202 1024 256 32 pic24ep512mc202 1024 512 48 pic24ep32mc203 512 32 4 544 6 122?32183/4yesyes2536vtla pic24ep64mc203 1024 64 8 pic24ep32mc204 512 32 4 544 6 122?32193/4yesyes3544 vtla ( 5 ) , tqfp, qfn pic24ep64mc204 1024 64 8 pic24ep128mc204 1024 128 16 pic24ep256mc204 1024 256 32 pic24ep512mc204 1024 512 48 pic24ep64mc206 1024 64 8 544 6 122?321163/4yesyes5364 tqfp, qfn pic24ep128mc206 1024 128 16 pic24ep256mc206 1024 256 32 pic24ep512mc206 1024 512 48 dspic33ep32mc202 512 32 4 544 6 122?32162/3 ( 1 ) yes yes 21 28 spdip, soic, ssop ( 5 ) , qfn-s dspic33ep64mc202 1024 64 8 dspic33ep128mc202 1024 128 16 dspic33ep256mc202 1024 256 32 dspic33ep512mc202 1024 512 48 dspic33ep32mc203 512 32 4 544 6 122?32183/4yesyes2536vtla dspic33ep64mc203 1024 64 8 dspic33ep32mc204 512 32 4 544 6 122?32193/4yesyes3544 vtla ( 5 ) , tqfp, qfn dspic33ep64mc204 1024 64 8 dspic33ep128mc204 1024 128 16 dspic33ep256mc204 1024 256 32 dspic33ep512mc204 1024 512 48 dspic33ep64mc206 1024 64 8 544 6 122?321163/4yesyes5364 tqfp, qfn dspic33ep128mc206 1024 128 16 dspic33ep256mc206 1024 256 32 dspic33ep512mc206 1024 512 48 dspic33ep32mc502 512 32 4 544 6 122132162/3 ( 1 ) yes yes 21 28 spdip, soic, ssop ( 5 ) , qfn-s dspic33ep64mc502 1024 64 8 dspic33ep128mc502 1024 128 16 dspic33ep256mc502 1024 256 32 dspic33ep512mc502 1024 512 48 dspic33ep32mc503 512 32 4 544 6 122132183/4yesyes2536vtla dspic33ep64mc503 1024 64 8 note 1: on 28-pin devices, comparator 4 does not have external connections. refer to section 25.0 ?op amp/comparator module? for details. 2: only spi2 is remappable. 3: int0 is not remappable. 4: only the pwm faults are remappable. 5: the ssop and vtla packages are not available for devices with 512 kbytes of memory.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 4 ? 2011-2013 microchip technology inc. dspic33ep32mc504 512 32 4 544 6 122132193/4yesyes3544 vtla ( 5 ) , tqfp, qfn dspic33ep64mc504 1024 64 8 DSPIC33EP128MC504 1024 128 16 dspic33ep256mc504 1024 256 32 dspic33ep512mc504 1024 512 48 dspic33ep64mc506 1024 64 8 544 6 1221321163/4yesyes5364 tqfp, qfn dspic33ep128mc506 1024 128 16 dspic33ep256mc506 1024 256 32 dspic33ep512mc506 1024 512 48 table 2: dspic33epxxxmc20x/50x and pic24epxxxmc20x motor control families (continued) device page erase size (instructions) program flash memory (kbytes) ram (kbytes) remappable peripherals i 2 c? crc generator 10-bit/12-bit adc (channels) op amps/comparators ctmu ptg i/o pins pins packages 16-bit/32-bit timers input capture output compare motor control pwm ( 4 ) (channels) quadrature encoder interface uart spi ( 2 ) ecan? technology external interrupts ( 3 ) note 1: on 28-pin devices, comparator 4 does not have external connections. refer to section 25.0 ?op amp/comparator module? for details. 2: only spi2 is remappable. 3: int0 is not remappable. 4: only the pwm faults are remappable. 5: the ssop and vtla packages are not available for devices with 512 kbytes of memory.
? 2011-2013 microchip technology inc. ds70657g-page 5 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x pin diagrams 28-pin spdip/soic/ssop (1,2) note 1: the rpn/rpin pins can be used by any rem appable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. = pins are up to 5v tolerant 128 227 326 425 524 623 722 821 920 10 19 11 18 12 17 13 16 14 15 pic24epxxxgp202 dspic33epxxxgp502 mclr av dd an0/oa2out/ra0 av ss an1/c2in1+/ra1 rpi47/t5ck/rb15 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 rpi46/t3ck/rb14 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi45/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 rpi44/rb12 pged1/an5/c1in1-/rp35/rb3 tdi/rp43/rb11 tdo/rp42/rb10 osc1/clki/ra2 v cap osc2/clko/ra3 v ss rp36/rb4 tms/asda1/sdi1/rp41/rb9 cv ref 2 o /rp20/t1ck/ra4 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 v dd sck1/rp39/int0/rb7 pged2/asda2/rp37/rb5 pgec2/ascl2/rp38/rb6 v ss 128 227 326 425 524 623 722 821 920 10 19 11 18 12 17 13 16 14 15 pic24epxxxmc202 dspic33epxxxmc202/502 mclr av dd an0/oa2out/ra0 av ss an1/c2in1+/ra1 rpi47/pwm1l/t5ck/rb15 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 rpi46/pwm1h/t3ck/rb14 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi45/pwm2l/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 rpi44/pwm2h/rb12 pged1/an5/c1in1-/rp35/rb3 tdi/rp43/pwm3l/rb11 tdo/rp42/pwm3h/rb10 osc1/clki/ra2 v cap osc2/clko/ra3 v ss flt32/rp36/rb4 tms/asda1/sdi1/rp41/rb9 cv ref 2 o /rp20/t1ck/ra4 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 v dd sck1/rp39/int0/rb7 pged2/asda2/rp37/rb5 pgec2/ascl2/rp38/rb6 v ss
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 6 ? 2011-2013 microchip technology inc. pin diagrams (continued) 28-pin qfn-s (1,2,3) = pins are up to 5v tolerant 28 27 26 25 24 23 22 8 9 10 11 12 13 14 3 18 17 16 15 4 5 7 1 2 20 19 6 21 pic24epxxxgp202 dspic33epxxxgp502 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 sck1/rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd cv ref 2 o /rp20/t1ck/ra4 rp36/rb4 rpi45/ctpls/rb13 rpi44/rb12 tdi/rp43/rb11 tdo/rp42/rb10 v cap v ss tms/asda1/sdi1/rp41/rb9 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 v ss osc1/clki/ra2 osc2/clko/ra3 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 note 1: the rpn/rpin pins can be used by any rem appable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally.
? 2011-2013 microchip technology inc. ds70657g-page 7 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x pin diagrams (continued) 28-pin qfn-s (1,2,3) = pins are up to 5v tolerant 28 27 26 25 24 23 22 8 9 10 11 12 13 14 3 18 17 16 15 4 5 7 1 2 20 19 6 21 pic24epxxxmc202 dspic33epxxxmc202/502 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 sck1/rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd cv ref 2 o /rp20/t1ck/ra4 flt32/rp36/rb4 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 tdi/rp43/pwm3l/rb11 tdo/rp42/pwm3h/rb10 v cap v ss tms/asda1/sdi1/rp41/rb9 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 v ss osc1/clki/ra2 osc2/clko/ra3 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notificati on (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 8 ? 2011-2013 microchip technology inc. pin diagrams (continued) 36-pin vtla (1,2,3) 1 10 33 32 31 30 29 28 2 3 4 5 6 24 23 22 21 20 19 11 12 13 14 15 7 8 9 34 35 36 16 17 18 27 26 25 = pins are up to 5v tolerant pic24ep32gp203 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 rpi45/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi44/rb12 tdi/rp43/rb11 tdo/rp42/rb10 v cap v ss rp56/rc8 tms/asda1/sdi1/rp41/rb9 sck1/rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss cv ref 2 o /rp20/t1ck/ra4 v dd scl2/rp36/rb4 v dd note 1: the rpn/rpin pins can be used by any remappable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. dspic33ep32gp503 pic24ep64gp203 dspic33ep64gp503
? 2011-2013 microchip technology inc. ds70657g-page 9 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x pin diagrams (continued) 36-pin vtla (1,2,3) = pins are up to 5v tolerant 1 10 33 32 31 30 29 28 2 3 4 5 6 24 23 22 21 20 19 11 12 13 14 15 7 8 9 34 35 36 16 17 18 27 26 25 pic24ep32mc203 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 rpi45/pwm2l/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi44/pwm2h/rb12 tdi/rp43/pwm3l/rb11 tdo/rp42/pwm3h/rb10 v cap v ss rp56/rc8 tms/asda1/sdi1/rp41/rb9 sck1/rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss cv ref 2 o /rp20/t1ck/ra4 v dd flt32/scl2/rp36/rb4 v dd note 1: the rpn/rpin pins can be used by any remappable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notificati on (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. dspic33ep32mc203/503 pic24ep64mc203 dspic33ep64mc203/503
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 10 ? 2011-2013 microchip technology inc. pin diagrams (continued) 44-pin tqfp (1,2) = pins are up to 5v tolerant 44 43 42 41 40 39 38 37 36 35 34 133 232 331 430 529 628 727 826 925 10 24 11 23 12 13 14 15 16 17 18 19 20 21 22 pic24epxxxgp204 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 tdo/ra10 rpi45/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 scl2/rp36/rb4 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi44/rb12 rp43/rb11 rp42/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 note 1: the rpn/rpin pins can be used by any rem appable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. dspic33epxxxgp504
? 2011-2013 microchip technology inc. ds70657g-page 11 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x pin diagrams (continued) 44-pin tqfp (1,2) = pins are up to 5v tolerant 44 43 42 41 40 39 38 37 36 35 34 133 232 331 430 529 628 727 826 925 10 24 11 23 12 13 14 15 16 17 18 19 20 21 22 pic24epxxxmc204 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 tdo/ra10 rpi45/pwm2l/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/flt3/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 flt32/scl2/rp36/rb4 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 note 1: the rpn/rpin pins can be used by any rem appable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. dspic33epxxxmc204/504
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 12 ? 2011-2013 microchip technology inc. pin diagrams (continued) 44-pin vtla (1,2,3) = pins are up to 5v tolerant pic24epxxxgp204 1 12 41 40 39 38 37 36 35 34 2 3 4 5 6 7 8 30 29 28 27 26 25 24 23 13 14 15 16 17 18 19 9 10 11 22 20 21 33 32 31 42 43 44 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 scl2/rp36/rb4 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 rpi45/ctpls/rb13 rpi44/rb12 rp43/rb11 rp42/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tdo/ra10 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 note 1: the rpn/rpin pins can be used by any rem appable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not c onnected to any pins and is recommended to be connected to v ss externally. dspic33epxxxgp504
? 2011-2013 microchip technology inc. ds70657g-page 13 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x pin diagrams (continued) 44-pin vtla (1,2,3) = pins are up to 5v tolerant pic24epxxxmc204 1 12 41 40 39 38 37 36 35 34 2 3 4 5 6 7 8 30 29 28 27 26 25 24 23 13 14 15 16 17 18 19 9 10 11 22 20 21 33 32 31 42 43 44 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/flt3/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 flt32/scl2/rp36/rb4 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tdo/ra10 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 note 1: the rpn/rpin pins can be used by any remappable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not c onnected to any pins and is recommended to be connected to v ss externally. dspic33epxxxmc204/504
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 14 ? 2011-2013 microchip technology inc. pin diagrams (continued) 44-pin qfn (1,2,3) = pins are up to 5v tolerant 44 43 42 41 40 39 38 37 36 35 12 13 14 15 16 17 18 19 20 21 3 30 29 28 27 26 25 24 23 4 5 7 8 9 10 11 1 2 32 31 6 22 33 34 pic24epxxxgp204 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 scl2/rp36/rb4 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 rpi45/ctpls/rb13 rpi44/rb12 rp43/rb11 rp42/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tdo/ra10 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 dspic33epxxxgp504 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notificati on (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally.
? 2011-2013 microchip technology inc. ds70657g-page 15 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x pin diagrams (continued) 44-pin qfn (1,2,3) = pins are up to 5v tolerant 44 43 42 41 40 39 38 37 36 35 12 13 14 15 16 17 18 19 20 21 3 30 29 28 27 26 25 24 23 4 5 7 8 9 10 11 1 2 32 31 6 22 33 34 pic24epxxxmc204 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/flt3/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 flt32/scl2/rp36/rb4 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tdo/ra10 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 dspic33epxxxmc204/504 note 1: the rpn/rpin pins can be used by any remappable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not c onnected to any pins and is recommended to be connected to v ss externally.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 16 ? 2011-2013 microchip technology inc. pin diagrams (continued) 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 148 247 346 445 544 643 742 841 940 10 39 11 38 12 37 13 36 14 35 15 34 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 rp118/rg6 rpi119/rg7 rp120/rg8 mclr rpi121/rg9 v ss v dd an10/rpi28/ra12 an9/rpi27/ra11 an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 tdo/ra10 rpi45/ctpls/rb13 rpi44/rb12 rp43/rb11 rp42/rb10 rp97/rf1 rpi96/rf0 v dd v cap rp57/rc9 rd6 rd5 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rc13 rp39/int0/rb7 rpi58/rc10 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 rd8 v ss osc2/clko/rc15 osc1/clki/rc12 v dd scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 av dd av ss an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/rc2 an11/c1in2- (3) /u1cts /rc11 v ss v dd an12/c2in2- (3) /u2rts /bclk2/re12 an13/c3in2- (3) /u2cts /re13 an14/rpi94/re14 an15/rpi95/re15 sda2/rpi24/ra8 scl2/rp36/rb4 dspic33ep64gp506 pic24ep64gp206 pic24ep128gp206 pic24ep256gp206 dspic33ep128gp506 dspic33ep256gp506 dspic33ep512gp506 pic24ep512gp206 note 1: the rpn/rpin pins can be used by any remappable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally.
? 2011-2013 microchip technology inc. ds70657g-page 17 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x pin diagrams (continued) 64-pin tqfp (1,2,3) = pins are up to 5v tolerant 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 148 247 346 445 544 643 742 841 940 10 39 11 38 12 37 13 36 14 35 15 34 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 rp118/rg6 rpi119/rg7 rp120/rg8 mclr rpi121/rg9 v ss v dd an10/rpi28/ra12 an9/rpi27/ra11 an0/oa2out/ra0 an1/c2in1+/ra1 pged3/ v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/ v ref +/an3/oa1out/rpi33/cted1/rb1 tdo/ra10 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 rp97/rf1 rpi96/rf0 v dd v cap rp57/rc9 rd6 rd5 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rc13 rp39/int0/rb7 rpi58/rc10 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 rd8 v ss osc2/clko/rc15 osc1/clki/rc12 v dd scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 av dd av ss an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts / bclk1/ flt3/rc2 an11/c1in2- (3) /u1cts /flt4/rc11 v ss v dd an12/c2in2- (3) /u2rts /bclk2/re12 an13/c3in2- (3) /u2cts /re13 an14/rpi94/re14 an15/rpi95/re15 sda2/rpi24/ra8 flt32 /scl2/rp36/rb4 pic24ep64mc206 dspic33ep64mc206/506 pic24ep128mc206 pic24ep256mc206 dspic33ep128mc206/506 dspic33ep256mc206/506 dspic33ep512mc206/506 pic24ep512mc206 note 1: the rpn/rpin pins can be used by any rema ppable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 18 ? 2011-2013 microchip technology inc. pin diagrams (continued) 64-pin qfn (1,2,3,4) = pins are up to 5v tolerant tdo/ra10 rpi45/ctpls/rb13 rpi44/rb12 rp43/rb11 rp42/rb10 rp97/rf1 rpi96/rf0 v dd v cap rp57/rc9 rd6 rd5 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tck/ cv ref 1 o /ascl1/rp40/t4ck/rb8 rc13 rp39/int0/rb7 rpi58/rc10 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 rd8 v ss osc2/clko/rc15 osc1/clki/rc12 v dd scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 av dd av ss an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts / bclk1/ rc2 an11/c1in2- (3) /u1cts /rc11 v ss v dd an12/c2in2- (3) /u2rts / bclk2/ re12 an13/c3in2- (3) /u2cts /re13 an14/rpi94/re14 an15/rpi95/re15 sda2/rpi24/ra8 scl2/rp36/rb4 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 rp118/rg6 rpi119/rg7 rp120/rg8 mclr rpi121/rg9 v ss v dd an10/rpi28/ra12 an9/rpi27/ra11 an0/oa2out/ra0 an1/c2in1+/ra1 pged3/ v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/ v ref +/an3/oa1out/rpi33/cted1/rb1 pic24ep64gp206 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 148 247 346 445 544 643 742 841 940 10 39 11 38 12 37 13 36 14 35 15 34 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 note 1: the rpn/rpin pins can be used by any rem appable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: this pin is not available as an input when opmode (cmxcon<10>) = 1 . 4: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. dspic33ep64gp506 pic24ep128gp206 pic24ep256gp206 dspic33ep128gp506 dspic33ep256gp506 dspic33ep512gp506 pic24ep512gp206
? 2011-2013 microchip technology inc. ds70657g-page 19 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x pin diagrams (continued) 64-pin qfn (1,2,3,4) = pins are up to 5v tolerant 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 148 247 346 445 544 643 742 841 940 10 39 11 38 12 37 13 36 14 35 15 34 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 tdo/ra10 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 rp97/rf1 rpi96/rf0 v dd v cap rp57/rc9 rd6 rd5 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tck/ cv ref 1 o /ascl1/rp40/t4ck/rb8 rc13 rp39/int0/rb7 rpi58/rc10 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 rd8 v ss osc2/clko/rc15 osc1/clki/rc12 v dd scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 av dd av ss an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts / bclk1/ flt3/rc2 an11/c1in2- (3) /u1cts /flt4/rc11 v ss v dd an12/c2in2- (3) /u2rts / bclk2/ re12 an13/c3in2- (3) /u2cts /re13 an14/rpi94/re14 an15/rpi95/re15 sda2/rpi24/ra8 flt32 /scl2/rp36/rb4 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 rp118/rg6 rpi119/rg7 rp120/rg8 mclr rpi121/rg9 v ss v dd an10/rpi28/ra12 an9/rpi27/ra11 an0/oa2out/ra0 an1/c2in1+/ra1 pged3/ v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/ v ref +/an3/oa1out/rpi33/cted1/rb1 pic24ep64mc206 dspic33ep64mc206/506 pic24ep128mc206 pic24ep256mc206 dspic33ep128mc206/506 dspic33ep256mc206/506 dspic33ep512mc206/506 pic24ep512mc206 note 1: the rpn/rpin pins can be used by any remappable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: this pin is not available as an input when opmode (cmxcon<10>) = 1 . 4: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 20 ? 2011-2013 microchip technology inc. table of contents 1.0 device overview ............................................................................................................. ........................................................... 23 2.0 guidelines for getting started with 16-bit digital signal controllers and microcontrollers .................................. ....................... 27 3.0 cpu ......................................................................................................................... ................................................................... 33 4.0 memory organization ......................................................................................................... ........................................................ 43 5.0 flash program memory........................................................................................................ .................................................... 117 6.0 resets ..................................................................................................................... ................................................................ 121 7.0 interrupt controller ........................................................................................................ ........................................................... 125 8.0 direct memory access (dma) .................................................................................................. ................................................ 137 9.0 oscillator configuration ...................................... .............................................................. ........................................................ 151 10.0 power-saving features...................................................................................................... ...................................................... 161 11.0 i/o ports .................................................................................................................. ................................................................. 171 12.0 timer1 ..................................................................................................................... ................................................................. 201 13.0 timer2/3 and timer4/5 ..................................................................................................... ....................................................... 205 14.0 input capture.............................................................................................................. .............................................................. 211 15.0 output compare ............................................................................................................. .......................................................... 217 16.0 high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) ....................................... 223 17.0 quadrature encoder interface (qei) module (dspic33epxxxmc 20x/50x and pic24epxxxmc20x devices only)........... 247 18.0 serial peripheral interface (spi).......................................................................................... ..................................................... 263 19.0 inter-integrated circuit? (i 2 c?)............................................................................................................................ .................. 271 20.0 universal asynchronous receiver transmitter (uart) ......................................................................... .................................. 279 21.0 enhanced can (ecan?) module (dspic33epxxxgp/mc50x devices only ) ............................................................ ......... 285 22.0 charge time measurement unit (ctmu) ....................................................................................... ........................................ 313 23.0 10-bit/12-bit analog-to-digital converter (adc) ............................................................................ .......................................... 319 24.0 peripheral trigger generator (ptg) module .................................................................................. .......................................... 335 25.0 op amp/comparator module ................................................................................................... ................................................ 353 26.0 programmable cyclic redundancy check (crc) generator ....................................................................... ........................... 371 27.0 special features ........................................................................................................... ........................................................... 377 28.0 instruction set summary .................................................................................................... ...................................................... 385 29.0 development support........................................................................................................ ....................................................... 395 30.0 electrical characteristics ................................................................................................. ......................................................... 399 31.0 high-temperature electrical characteristics................................................................................ ............................................ 465 32.0 dc and ac device characteristics graphs.................................................................................... .......................................... 473 33.0 packaging information...................................................................................................... ........................................................ 477 appendix a: revision history................................................................................................... .......................................................... 503 index .......................................................................................................................... ....................................................................... 513 the microchip web site ......................................................................................................... ............................................................ 521 customer change notification service ........................................................................................... ................................................... 521 customer support ............................................................................................................... ............................................................... 521 reader response ................................................................................................................ .............................................................. 522 product identification system.................................................................................................. ........................................................... 523
? 2011-2013 microchip technology inc. ds70657g-page 21 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x to our valued customers it is our intention to provide our valued customers with the best documentation possible to ensure successful use of your micro chip products. to this end, we will continue to improve our publications to better suit your needs. our publications will be refined and enhanced as new volumes and updates are introduced. if you have any questions or comments regarding this publicat ion, please contact the marketing communications department via e-mail at docerrors@microchip.com or fax the reader response form in the back of this data sheet to (480) 792-4150. we welcome your feedback. most current data sheet to obtain the most up-to-date version of this data s heet, please register at our worldwide web site at: http://www.microchip.com you can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page . the last character of the literature number is the vers ion number, (e.g., ds30000a is version a of document ds30000). errata an errata sheet, describing minor operational differences fr om the data sheet and recommended workarounds, may exist for curren t devices. as device/documentation issues become known to us, we will publish an errata sheet. the errata will specify the revisi on of silicon and revision of document to which it applies. to determine if an errata sheet exists for a particul ar device, please check with one of the following: ? microchip?s worldwide web site; http://www.microchip.com ? your local microchip sales office (see last page) when contacting a sales office, please spec ify which device, revision of silicon and data sheet (include literature number) you are using. customer notification system register on our web site at www.microchip.com to receive the most current information on all of our products.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 22 ? 2011-2013 microchip technology inc. referenced sources this device data sheet is based on the following individual chapters of the ?dspic33e/pic24e family reference manual? . these documents should be considered as the general reference for the operation of a particular module or device feature. ? section 1. ?introduction? (ds70573) ? section 2. ?cpu? (ds70359) ? section 3. ?data memory? (ds70595) ? section 4. ?program memory? (ds70613) ? section 5. ?flash programming? (ds70609) ? section 6. ?interrupts? (ds70600) ? section 7. ?oscillator? (ds70580) ? section 8. ?reset? (ds70602) ? section 9. ?watchdog timer and power-saving modes? (ds70615) ? section 10. ?i/o ports? (ds70598) ? section 11. ?timers? (ds70362) ? section 12. ?input capture? (ds70352) ? section 13. ?output compare? (ds70358) ? section 14. ?high-speed pwm? (ds70645) ? section 15. ?quadrature encoder interface (qei)? (ds70601) ? section 16. ?analog-to-digital converter (adc)? (ds70621) ? section 17. ?uart? (ds70582) ? section 18. ?serial peripheral interface (spi)? (ds70569) ? section 19. ?inter-integrated circuit (i 2 c?)? (ds70330) ? section 21. ?enhanced controller area network (ecan?)? (ds70353) ? section 22. ?direct memory access (dma)? (ds70348) ? section 23. ?codeguard? security? (ds70634) ? section 24. ?programming and diagnostics? (ds70608) ? section 26. ?op amp/comparator? (ds70357) ? section 27. ?programmable cyclic redundancy check (crc)? (ds70346) ? section 30. ?device configuration? (ds70618) ? section 32. ?peripheral trigger generator (ptg)? (ds70669) ? section 33. ?charge time measurement unit (ctmu)? (ds70661) note 1: to access the documents listed below, browse to the documentation section of the dspic33ep64mc506 product page of the microchip web site ( www.microchip.com ) or select a family reference manual section from the following list. in addition to parameters, features, and other documentation, the resulting page provides links to the related family reference manual sections.
? 2011-2013 microchip technology inc. ds70657g-page 23 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 1.0 device overview this document contains devic e-specific information for the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x digital signal controller (dsc) and microcontroller (mcu) devices. dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices contain extensive digital signal processor (dsp) functionality with a high-performance 16-bit mcu architecture. figure 1-1 shows a general block diagram of the core and peripheral modules. table 1-1 lists the functions of the various pins shown in the pinout diagrams. figure 1-1: dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x block diagram note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a com- prehensive resource. to complement the information in this data sheet, refer to the related section of the ? dspic33e/ pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ) 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. porta power-up timer oscillator start-up osc1/clki mclr v dd , v ss uart1, timing generation ecan1 (2) i2c1, adc timers input capture output compare av dd , av ss uart2 spi2 spi1, watchdog timer por/bor crc i2c2 qei1 (1) pwm (1) remappable pins note 1: this feature or peripheral is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices. 2: this feature or peripheral is only av ailable on dspic33epxxxgp/mc50x devices. op amp/ comparator ctmu ptg cpu refer to figure 3-1 for cpu diagram details. 16 16 porta portc portd porte portf portg ports peripheral modules timer
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 24 ? 2011-2013 microchip technology inc. table 1-1: pinout i/o descriptions pin name ( 4 ) pin type buffer type pps description an0-an15 i analog no analog input channels. clki clko i o st/ cmos ? no no external clock source input. always associated with osc1 pin function. oscillator crystal output. connects to crystal or resonator in crystal oscillator mode. optionally functions as clko in rc and ec modes. always associated with osc2 pin function. osc1 osc2 i i/o st/ cmos ? no no oscillator crystal input. st buffer when configured in rc mode; cmos otherwise. oscillator crystal output. connects to crystal or resonator in crystal oscillator mode. optionally functions as clko in rc and ec modes. refclko o ? yes reference clock output. ic1-ic4 i st yes capture inputs 1 through 4. ocfa ocfb oc1-oc4 i i o st st ? yes no yes compare fault a input (for compare channels). compare fault b input (for compare channels). compare outputs 1 through 4. int0 int1 int2 i i i st st st no yes yes external interrupt 0. external interrupt 1. external interrupt 2. ra0-ra4, ra7-ra12 i/o st no porta is a bidirectional i/o port. rb0-rb15 i/o st no portb is a bidirectional i/o port. rc0-rc13, rc15 i/o st no portc is a bidirectional i/o port. rd5, rd6, rd8 i/o st no portd is a bidirectional i/o port. re12-re15 i/o st no porte is a bidirectional i/o port. rf0, rf1 i/o st no portf is a bidirectional i/o port. rg6-rg9 i/o st no portg is a bidirectional i/o port. t1ck t2ck t3ck t4ck t5ck i i i i i st st st st st no yes no no no timer1 external clock input. timer2 external clock input. timer3 external clock input. timer4 external clock input. timer5 external clock input. ctpls cted1 cted2 o i i st st st no no no ctmu pulse output. ctmu external edge input 1. ctmu external edge input 2. u1cts u1rts u1rx u1tx bclk1 i o i o o st ? st ? st no no yes yes no uart1 clear-to-send. uart1 ready-to-send. uart1 receive. uart1 transmit. uart1 irda ? baud clock output. legend: cmos = cmos compatible input or output analog = analog input p = power st = schmitt trigger input with cmos levels o = output i = input pps = peripheral pin select ttl = ttl input buffer note 1: this pin is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this pin is available on dspic33epxxxgp/mc50x devices only. 3: this is the default fault on reset for dspic 33epxxxmc20x/50x and pic24epxxxmc20x devices. see section 16.0 ?high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? for more information. 4: not all pins are available in all packages variants. see the ?pin diagrams? section for pin availability.
? 2011-2013 microchip technology inc. ds70657g-page 25 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x u2cts u2rts u2rx u2tx bclk2 i o i o o st ? st ? st no no yes yes no uart2 clear-to-send. uart2 ready-to-send. uart2 receive. uart2 transmit. uart2 irda baud clock output. sck1 sdi1 sdo1 ss1 i/o i o i/o st st ? st no no no no synchronous serial clock input/output for spi1. spi1 data in. spi1 data out. spi1 slave synchronization or frame pulse i/o. sck2 sdi2 sdo2 ss2 i/o i o i/o st st ? st yes yes yes yes synchronous serial clock input/output for spi2. spi2 data in. spi2 data out. spi2 slave synchronization or frame pulse i/o. scl1 sda1 ascl1 asda1 i/o i/o i/o i/o st st st st no no no no synchronous serial clock input/output for i2c1. synchronous serial data input/output for i2c1. alternate synchronous serial clock input/output for i2c1. alternate synchronous serial data input/output for i2c1. scl2 sda2 ascl2 asda2 i/o i/o i/o i/o st st st st no no no no synchronous serial clock input/output for i2c2. synchronous serial data input/output for i2c2. alternate synchronous serial clock input/output for i2c2. alternate synchronous serial data input/output for i2c2. tms tck tdi tdo i i i o st st st ? no no no no jtag test mode select pin. jtag test clock input pin. jtag test data input pin. jtag test data output pin. c1rx ( 2 ) c1tx ( 2 ) i o st ? yes yes ecan1 bus receive pin. ecan1 bus transmit pin. flt1 ( 1 ) , flt2 ( 1 ) flt3 ( 1 ) , flt4 ( 1 ) flt32 ( 1 , 3 ) dtcmp1-dtcmp3 ( 1 ) pwm1l-pwm3l ( 1 ) pwm1h-pwm3h ( 1 ) synci1 ( 1 ) synco1 ( 1 ) i i i i o o i o st st st st ? ? st ? yes no no yes no no yes yes pwm fault input 1 and 2. pwm fault input 3 and 4. pwm fault input 32 (class b fault). pwm dead-time compensation input 1 through 3. pwm low output 1 through 3. pwm high output 1 through 3. pwm synchronization input 1. pwm synchronization output 1. indx1 ( 1 ) home1 ( 1 ) qea1 ( 1 ) qeb1 ( 1 ) cntcmp1 ( 1 ) i i i i o st st st st ? yes yes yes yes yes quadrature encoder index1 pulse input. quadrature encoder home1 pulse input. quadrature encoder phase a input in qei1 mode. auxiliary timer external clock/gate input in timer mode. quadrature encoder phase b input in qei1 mode. auxiliary timer external clock/gate input in timer mode. quadrature encoder compare output 1. table 1-1: pinout i/o descriptions (continued) pin name ( 4 ) pin type buffer type pps description legend: cmos = cmos compatible input or output analog = analog input p = power st = schmitt trigger input with cmos levels o = output i = input pps = peripheral pin select ttl = ttl input buffer note 1: this pin is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this pin is available on dspic33epxxxgp/mc50x devices only. 3: this is the default fault on reset for dspic 33epxxxmc20x/50x and pic24epxxxmc20x devices. see section 16.0 ?high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? for more information. 4: not all pins are available in all packages variants. see the ?pin diagrams? section for pin availability.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 26 ? 2011-2013 microchip technology inc. c1in1- c1in2- c1in1+ oa1out c1out i i i o o analog analog analog analog ? no no no no yes op amp/comparator 1 negative input 1. comparator 1 negative input 2. op amp/comparator 1 positive input 1. op amp 1 output. comparator 1 output. c2in1- c2in2- c2in1+ oa2out c2out i i i o o analog analog analog analog ? no no no no yes op amp/comparator 2 negative input 1. comparator 2 negative input 2. op amp/comparator 2 positive input 1. op amp 2 output. comparator 2 output. c3in1- c3in2- c3in1+ oa3out c3out i i i o o analog analog analog analog ? no no no no yes op amp/comparator 3 negative input 1. comparator 3 negative input 2. op amp/comparator 3 positive input 1. op amp 3 output. comparator 3 output. c4in1- c4in1+ c4out i i o analog analog ? no no yes comparator 4 negative input 1. comparator 4 positive input 1. comparator 4 output. cv ref 1 o c vref 2 o o o analog analog no no op amp/comparator voltage reference output. op amp/comparator voltage reference divided by 2 output. pged1 pgec1 pged2 pgec2 pged3 pgec3 i/o i i/o i i/o i st st st st st st no no no no no no data i/o pin for programming/debugging communication channel 1. clock input pin for programming/debugging communication channel 1. data i/o pin for programming/debugging communication channel 2. clock input pin for programming/debugging communication channel 2. data i/o pin for programming/debugging communication channel 3. clock input pin for programming/debugging communication channel 3. mclr i/p st no master clear (reset) input. this pin is an active-low reset to the device. av dd p p no positive supply for analog modules. this pin must be connected at all times. av ss p p no ground reference for analog modules. this pin must be connected at all times. v dd p ? no positive supply for peripheral logic and i/o pins. v cap p ? no cpu logic filter capacitor connection. v ss p ? no ground reference for logic and i/o pins. v ref + i analog no analog voltage reference (high) input. v ref - i analog no analog voltage reference (low) input. table 1-1: pinout i/o descriptions (continued) pin name ( 4 ) pin type buffer type pps description legend: cmos = cmos compatible input or output analog = analog input p = power st = schmitt trigger input with cmos levels o = output i = input pps = peripheral pin select ttl = ttl input buffer note 1: this pin is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this pin is available on dspic33epxxxgp/mc50x devices only. 3: this is the default fault on reset for dspic 33epxxxmc20x/50x and pic24epxxxmc20x devices. see section 16.0 ?high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? for more information. 4: not all pins are available in all packages variants. see the ?pin diagrams? section for pin availability.
? 2011-2013 microchip technology inc. ds70657g-page 27 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 2.0 guidelines for getting started with 16-bit digital signal controllers and microcontrollers 2.1 basic connection requirements getting started with the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x familie s requires attention to a minimal set of device pin connections before proceeding with development. the following is a list of pin names, which must always be connected: ?all v dd and v ss pins (see section 2.2 ?decoupling capacitors? ) ?all av dd and av ss pins (regardless if adc module is not used) (see section 2.2 ?decoupling capacitors? ) ?v cap (see section 2.3 ?cpu logic filter capacitor connection (v cap )? ) ?mclr pin (see section 2.4 ?master clear (mclr) pin? ) ? pgecx/pgedx pins used for in-circuit serial programming? (icsp?) and debugging purposes (see section 2.5 ?icsp pins? ) ? osc1 and osc2 pins when external oscillator source is used (see section 2.6 ?external oscillator pins? ) additionally, the following pins may be required: ?v ref +/v ref - pins are used when external voltage reference for adc module is implemented 2.2 decoupling capacitors the use of decoupling capacitors on every pair of power supply pins, such as v dd , v ss , av dd and av ss is required. consider the following criteria when using decoupling capacitors: ? value and type of capacitor: recommendation of 0.1 f (100 nf), 10-20v. this capacitor should be a low-esr and have resonance frequency in the range of 20 mhz and higher. it is recommended to use ceramic capacitors. ? placement on the printed circuit board: the decoupling capacitors should be placed as close to the pins as possible. it is recommended to place the capacitors on the same side of the board as the device. if space is constricted, the capacitor can be placed on another layer on the pcb using a via; however, ensure that the trace length from the pin to the capacitor is within one-quarter inch (6 mm) in length. ? handling high-frequency noise: if the board is experiencing high-frequency noise, above tens of mhz, add a second ceramic-type capacitor in parallel to the above described decoupling capacitor. the value of the second capacitor can be in the range of 0.01 f to 0.001 f. place this second capacitor next to the primary decoupling capacitor. in high-speed circuit designs, consider implementing a decade pair of capacitances as close to the power and ground pins as possible. for example, 0.1 f in parallel with 0.001 f. ? maximizing performance: on the board layout from the power supply circuit, run the power and return traces to the decoupling capacitors first, and then to the device pins. this ensures that the decoupling capacitors are first in the power chain. equally important is to keep the trace length between the capacitor and the power pins to a minimum, thereby reducing pcb track inductance. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the related section of the ? dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ) 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: the av dd and av ss pins must be connected independent of the adc voltage reference source.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 28 ? 2011-2013 microchip technology inc. figure 2-1: recommended minimum connection 2.2.1 tank capacitors on boards with power traces running longer than six inches in length, it is suggested to use a tank capacitor for integrated circuits including dscs to supply a local power source. the value of the tank capacitor should be determined based on the trace resistance that con- nects the power supply source to the device and the maximum current drawn by the device in the applica- tion. in other words, select the tank capacitor so that it meets the acceptable voltage sag at the device. typical values range from 4.7 f to 47 f. 2.3 cpu logic filter capacitor connection (v cap ) a low-esr (< 1 ohms) capacitor is required on the v cap pin, which is used to stabilize the voltage regulator output voltage. the v cap pin must not be connected to v dd and must have a capacitor greater than 4.7 f (10 f is recommended), 16v connected to ground. the type can be ceramic or tantalum. see section 30.0 ?electrical characteristics? for additional information. the placement of this capacitor should be close to the v cap pin. it is recommended that the trace length not exceeds one-quarter inch (6 mm). see section 27.3 ?on-chip voltage regulator? for details. 2.4 master clear (mclr ) pin the mclr pin provides two specific device functions: ? device reset ? device programming and debugging. during device programming and debugging, the resistance and capacitance that can be added to the pin must be considered. device programmers and debuggers drive the mclr pin. consequently, specific voltage levels (v ih and v il ) and fast signal transitions must not be adversely affected. therefore, specific values of r and c will need to be adjusted based on the application and pcb requirements. for example, as shown in figure 2-2 , it is recommended that the capacitor c, be isolated from the mclr pin during programming and debugging operations. place the components as shown in figure 2-2 within one-quarter inch (6 mm) from the mclr pin. figure 2-2: example of mclr pin connections dspic33e/pic24e v dd v ss v dd v ss v ss v dd av dd av ss v dd v ss 0.1 f ceramic 0.1 f ceramic 0.1 f ceramic 0.1 f ceramic c r v dd mclr 0.1 f ceramic v cap l1 (1) r1 10 f tantalum note 1: as an option, instead of a hard-wired connection, an inductor (l1) can be substituted between v dd and av dd to improve adc noise rejection. the inductor impedance should be less than 1 ? and the inductor capacity greater than 10 ma. where: f f cnv 2 ------------- - = f 1 2 ? lc ?? ----------------------- = l 1 2 ? fc ?? --------------------- - ?? ?? 2 = (i.e., adc conversion rate/2) note 1: r ? 10 k ? is recommended. a suggested starting value is 10 k ? . ensure that the mclr pin v ih and v il specifications are met. 2: r1 ? 470 ? will limit any current flowing into mclr from the external capacitor c, in the event of mclr pin breakdown, due to electrostatic discharge (esd) or electrical overstress (eos). ensure that the mclr pin v ih and v il specifications are met. c r1 (2) r (1) v dd mclr dspic33ep/pic24ep jp
? 2011-2013 microchip technology inc. ds70657g-page 29 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 2.5 icsp pins the pgecx and pgedx pins are used for icsp and debugging purposes. it is recommended to keep the trace length between the icsp connector and the icsp pins on the device as short as possible. if the icsp con- nector is expected to experience an esd event, a series resistor is recommended, with the value in the range of a few tens of ohms, not to exceed 100 ohms. pull-up resistors, series diodes and capacitors on the pgecx and pgedx pins are not recommended as they will interfere with the programmer/debugger communi- cations to the device. if such discrete components are an application requirement, they should be removed from the circuit during programming and debugging. alternatively, refer to the ac/dc characteristics and timing requirements information in the respective device flash programming specification for information on capacitive loading limits and pin voltage input high (v ih ) and voltage input low (v il ) requirements. ensure that the ?communication channel select? (i.e., pgecx/pgedx pins) programmed into the device matches the physical connections for the icsp to mplab ? pickit? 3, mplab icd 3, or mplab real ice?. for more information on icd 2, icd 3 and real ice connection requirements, refer to the following documents that are available on the microchip web site. ? ?using mplab ? icd 3? (poster) ds51765 ? ?mplab ? icd 3 design advisory? ds51764 ? ?mplab ? real ice? in-circuit emulator user?s guide? ds51616 ? ?using mplab ? real ice? in-circuit emulator? (poster) ds51749 2.6 external oscillator pins many dscs have options for at least two oscillators: a high-frequency primary oscillator and a low-frequency secondary oscillator. for details, see section 9.0 ?oscillator configuration? for details. the oscillator circuit should be placed on the same side of the board as the device. also, place the oscillator circuit close to the respective oscillator pins, not exceeding one-half inch (12 mm) distance between them. the load capacitors should be placed next to the oscillator itself, on the same side of the board. use a grounded copper pour around the oscillator circuit to isolate them from surrounding circuits. the grounded copper pour should be routed directly to the mcu ground. do not run any signal traces or power traces inside the ground pour. also, if using a two-sided board, avoid any traces on the other side of the board where the crystal is placed. a suggested layout is shown in figure 2-3 . figure 2-3: suggested placement of the oscillator circuit main oscillator guard ring guard trace oscillator pins
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 30 ? 2011-2013 microchip technology inc. 2.7 oscillator value conditions on device start-up if the pll of the target device is enabled and configured for the device start-up oscillator, the maximum oscillator source frequency must be limited to 3 mhz < f in < 5.5 mhz to comply with device pll start-up conditions. this means that if the external oscillator frequency is outside this range, the application must start-up in the frc mode first. the default pll settings after a por with an oscillator frequency outside this range will violate the device operating speed. once the device powers up, the application firmware can initialize the pll sfrs, clkdiv and plldbf to a suitable value, and then perform a clock switch to the oscillator + pll clock source. note that clock switching must be enabled in the device configuration word. 2.8 unused i/os unused i/o pins should be configured as outputs and driven to a logic-low state. alternatively, connect a 1k to 10k resistor between v ss and unused pins and drive the output to logic low. 2.9 application examples ? induction heating ? uninterruptable power supplies (ups) ? dc/ac inverters ? compressor motor control ? washing machine 3-phase motor control ? bldc motor control ? automotive hvac, cooling fans, fuel pumps ? stepper motor control ? audio and fluid sensor monitoring ? camera lens focus and stability control ? speech (playback, hands-free kits, answering machines, voip) ? consumer audio ? industrial and building control (security systems and access control) ? barcode reading ? networking: lan switches, gateways ? data storage device management ? smart cards and smart card readers examples of typical application connections are shown in figure 2-4 through figure 2-8 . figure 2-4: boost converter implementation i pfc v output adc channel op amp/ adc channel pwm k 1 k 2 k 3 fet dspic33ep v input comparator output driver
? 2011-2013 microchip technology inc. ds70657g-page 31 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 2-5: single-phase synchronous buck converter figure 2-6: multi-phase synchronous buck converter k 1 op amp/ comparator k 2 k 7 pwm pwm adc channel adc channel 5v output i 5v 12v input fet driver dspic33ep k 5 k 4 k 3 k 6 k 7 op amp/comparator op amp/comparator adc channel op amp/comparator adc channel pwm pwm pwm pwm pwm pwm 3.3v output 12v input fet driver fet driver fet driver dspic33ep
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 32 ? 2011-2013 microchip technology inc. figure 2-7: interleaved pfc figure 2-8: bemf voltage measured using the adc module v ac v out + op amp/comparator pwm adc pwm |v ac | k 4 k 3 fet dspic33ep driver v out - adc channel fet driver op amp/ k 1 k 2 comparator channel op amp/ comparator 3-phase inverter pwm3h pwm3l pwm2h pwm2l pwm1h pwm1l fltx fault bldc dspic33ep/pic24ep an3 an4 an5 an2 demand phase terminal voltage feedback r49 r41 r34 r36 r44 r52
? 2011-2013 microchip technology inc. ds70657g-page 33 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 3.0 cpu the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x cpu have a 16-bit (data) modified harvard architecture with an enhanced instruction set, including significant support for digital signal processing. the cpu has a 24-bit instruction word, with a variable length opcode field. the program counter (pc) is 23 bits wide and addresses up to 4m x 24 bits of user program memory space. an instruction prefetch mechanism helps maintain throughput and provides predictable execution. most instructions execute in a single-cycle effective execu- tion rate, with the exception of instructions that change the program flow, the double-word move ( mov.d ) instruction, psv accesses and the table instructions. overhead-free program loop constructs are supported using the do and repeat instructions, both of which are interruptible at any point. 3.1 registers the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices have six- teen, 16-bit working registers in the programmer?s model. each of the working registers can act as a data, address or address offset register. the 16th working register (w15) operates as a software stack pointer for interrupts and calls. 3.2 instruction set the instruction set for dspic33epxxxgp50x and dspic33epxxxmc20x/50x devices has two classes of instructions: the mcu class of instructions and the dsp class of instructions. the instruction set for pic24epxxxgp/mc20x devices has the mcu class of instructions only and does not support dsp instructions. these two instruction classes are seamlessly integrated into the architecture and execute from a single execution unit. the instruction set includes many addressing modes and was designed for optimum c compiler efficiency. 3.3 data space addressing the base data space can be addressed as 64 kbytes (32k words). the data space includes two ranges of memory, referred to as x and y data memory. each memory range is accessible through its own independent address generation unit (agu). the mcu class of instructions operates solely through the x memory agu, which accesses the entire memory map as one linear data space. on dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices, certain dsp instructions operate through the x and y agus to support dual operand reads, which splits the data address space into two parts. the x and y data spaces have memory locations that are device-specific, and are described further in the data memory maps in section 4.2 ?data address space? . the upper 32 kbytes of the data space memory map can optionally be mapped into program space (ps) at any 32-kbyte aligned program word boundary. the program-to-data space mapping feature, known as program space visibility (psv), lets any instruction access program space as if it were data space. moreover, the base data space address is used in conjunction with a read or write page register (dsrpag or dswpag) to form an extended data space (eds) address. the eds can be addressed as 8m words or 16 mbytes. refer to section 3. ?data memory? (ds70595) and section 4. ?program memory? (ds70613) in the ?dspic33e/pic24e family reference manual? for more details on eds, psv and table accesses. on the dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices, overhead-free circular buffers (modulo addressing) are supported in both x and y address spaces. the modulo addressing removes the software boundary checking overhead for dsp algorithms. the x agu circular addressing can be used with any of the mcu class of instructions. the x agu also supports bit-reversed addressing to greatly simplify input or output data re-ordering for radix-2 fft algorithms. pic24epxxxgp/mc20x devices do not support modulo and bit-reversed addressing. 3.4 addressing modes the cpu supports these addressing modes: ? inherent (no operand) ? relative ?literal ? memory direct ? register direct ? register indirect each instruction is associated with a predefined addressing mode group, depending upon its functional requirements. as many as six addressing modes are supported for each instruction. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 2. ?cpu? (ds70359) in the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 34 ? 2011-2013 microchip technology inc. figure 3-1: dspic33epxxxgp50x, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x cpu block diagram instruction decode and control 16 pcl 16 program counter 16-bit alu 24 24 24 24 x data bus pcu 16 16 16 divide support engine (1) dsp rom latch 16 y data bus (1) ea mux x ragu x wagu y agu (1) 16 24 16 16 16 16 16 16 16 8 interrupt controller psv and table data access control block stack control logic loop control logic data latch data latch y data ram (1) x data ram address latch address latch 16 data latch 16 16 16 x address bus y address bus 24 literal data program memory address latch power, reset and oscillator control signals to various blocks ports peripheral modules note 1: this feature is not available on pic24epxxxgp/mc20x devices. modules pch ir 16 x 16 w register array
? 2011-2013 microchip technology inc. ds70657g-page 35 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 3.5 programmer?s model the programmer?s model for the dspic33epxxxgp50x, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x is shown in figure 3-2 . all registers in the programmer?s model are memory mapped and can be manipulated directly by instructions. tab l e 3 - 1 lists a description of each register. in addition to the registers contained in the programmer?s model, the dspic33epxxxgp50x, dspic33epxxxmc20x/50x, and pic24epxxxgp/ mc20x devices contain control registers for modulo addressing (dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only), bit-reversed addressing (dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only) and interrupts. these registers are described in subsequent sections of this document. all registers associated with the programmer?s model are memory mapped, as shown in ta b l e 4 - 1 . table 3-1: programmer?s model register descriptions register(s) name description w0 through w15 working register array acca, accb 40-bit dsp accumulators pc 23-bit program counter sr alu and dsp engine status register splim stack pointer limit value register tblpag table memory page address register dsrpag extended data space (eds) read page register dswpag extended data space (eds) write page register rcount repeat loop count register dcount ( 1 ) do loop count register dostarth ( 1 , 2 ) , dostartl ( 1 , 2 ) do loop start address register (high and low) doendh ( 1 ) , doendl ( 1 ) do loop end address register (high and low) corcon contains dsp engine, do loop control and trap status bits note 1: this register is available on dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only. 2: the dostarth and dostartl registers are read-only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 36 ? 2011-2013 microchip technology inc. figure 3-2: programmer?s model novz c tblpag pc23 pc0 7 0 d0 d15 program counter data table page address status register working/address registers dsp operand registers w0 (wreg) w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 frame pointer/w14 stack pointer/w15 dsp address registers ad39 ad0 ad31 dsp accumulators (1) acca accb dsrpag 9 0 ra 0 oa (1) ob (1) sa (1) sb (1) rcount 15 0 repeat loop counter dcount 15 0 do loop counter and stack (1) dostart 23 0 do loop start address and stack (1) 0 doend do loop end address and stack (1) ipl2 ipl1 splim stack pointer limit ad15 23 0 srl ipl0 push.s and pop.s shadows nested do stack 0 0 oab (1) sab (1) x data space read page address da (1) dc 0 0 0 0 dswpag x data space write page address 8 0 note 1: this feature or bit is available on dspic33e pxxxmc20x/50x and dspic33epxxxgp50x devices only. corcon 15 0 cpu core control register
? 2011-2013 microchip technology inc. ds70657g-page 37 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 3.6 cpu resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 3.6.1 key resources ? section 2. ?cpu? (ds70359) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 38 ? 2011-2013 microchip technology inc. 3.7 cpu control registers register 3-1: sr: cpu status register r/w-0 r/w-0 r/w-0 r/w-0 r/c-0 r/c-0 r-0 r/w-0 oa ( 1 ) ob ( 1 ) sa ( 1 , 4 ) sb ( 1 , 4 ) oab ( 1 ) sab ( 1 ) da ( 1 ) dc bit 15 bit 8 r/w-0 ( 2 , 3 ) r/w-0 ( 2 , 3 ) r/w-0 ( 2 , 3 ) r-0 r/w-0 r/w-0 r/w-0 r/w-0 ipl<2:0> ra n ov z c bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1?= bit is set ?0? = bit is cleared x = bit is unknown bit 15 oa: accumulator a overflow status bit ( 1 ) 1 = accumulator a has overflowed 0 = accumulator a has not overflowed bit 14 ob: accumulator b overflow status bit ( 1 ) 1 = accumulator b has overflowed 0 = accumulator b has not overflowed bit 13 sa: accumulator a saturation ?sticky? status bit ( 1 , 4 ) 1 = accumulator a is saturated or has been saturated at some time 0 = accumulator a is not saturated bit 12 sb: accumulator b saturation ?sticky? status bit ( 1 , 4 ) 1 = accumulator b is saturated or has been saturated at some time 0 = accumulator b is not saturated bit 11 oab: oa || ob combined accumulator overflow status bit ( 1 ) 1 = accumulators a or b have overflowed 0 = neither accumulators a or b have overflowed bit 10 sab: sa || sb combined accumulator ?sticky? status bit ( 1 ) 1 = accumulators a or b are saturated or have been saturated at some time 0 = neither accumulator a or b are saturated bit 9 da: do loop active bit ( 1 ) 1 = do loop in progress 0 = do loop not in progress bit 8 dc: mcu alu half carry/borrow bit 1 = a carry-out from the 4th low-order bit (for byte-sized data) or 8th low-order bit (for word-sized data) of the result occurred 0 = no carry-out from the 4th low-order bit (for byte-sized data) or 8th low-order bit (for word-sized data) of the result occurred note 1: this bit is available on dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only. 2: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read-only when the nstdis bit (intcon1<15>) = 1 . 4: a data write to the sr register can modify the sa and sb bits by either a data write to sa and sb or by clearing the sab bit. to avoid a possible sa or sb bit write race condition, the sa and sb bits should not be modified using bit operations.
? 2011-2013 microchip technology inc. ds70657g-page 39 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 7-5 ipl<2:0>: cpu interrupt priority level status bits ( 2 , 3 ) 111 = cpu interrupt priority level is 7 (15); user interrupts are disabled 110 = cpu interrupt priority level is 6 (14) 101 = cpu interrupt priority level is 5 (13) 100 = cpu interrupt priority level is 4 (12) 011 = cpu interrupt priority level is 3 (11) 010 = cpu interrupt priority level is 2 (10) 001 = cpu interrupt priority level is 1 (9) 000 = cpu interrupt priority level is 0 (8) bit 4 ra: repeat loop active bit 1 = repeat loop in progress 0 = repeat loop not in progress bit 3 n: mcu alu negative bit 1 = result was negative 0 = result was non-negative (zero or positive) bit 2 ov: mcu alu overflow bit this bit is used for signed arithmetic (2?s complement). it indicates an overflow of the magnitude that causes the sign bit to change state. 1 = overflow occurred for signed arithmetic (in this arithmetic operation) 0 = no overflow occurred bit 1 z: mcu alu zero bit 1 = an operation that affects the z bit has set it at some time in the past 0 = the most recent operation that affects the z bit has cleared it (i.e., a non-zero result) bit 0 c: mcu alu carry/borrow bit 1 = a carry-out from the most significant bit of the result occurred 0 = no carry-out from the most significant bit of the result occurred register 3-1: sr: cpu status register (continued) note 1: this bit is available on dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only. 2: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read-only when the nstdis bit (intcon1<15>) = 1 . 4: a data write to the sr register can modify the sa and sb bits by either a data write to sa and sb or by clearing the sab bit. to avoid a possible sa or sb bit write race condition, the sa and sb bits should not be modified using bit operations.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 40 ? 2011-2013 microchip technology inc. register 3-2: corcon: core control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r-0 r-0 r-0 var ? us<1:0> ( 1 ) edt ( 1 , 2 ) dl<2:0> ( 1 ) bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-0 r/c-0 r-0 r/w-0 r/w-0 sata ( 1 ) satb ( 1 ) satdw ( 1 ) accsat ( 1 ) ipl3 ( 3 ) sfa rnd ( 1 ) if ( 1 ) bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 var: variable exception processing latency control bit 1 = variable exception processing is enabled 0 = fixed exception processing is enabled bit 14 unimplemented: read as ? 0 ? bit 13-12 us<1:0>: dsp multiply unsigned/signed control bits ( 1 ) 11 = reserved 10 = dsp engine multiplies are mixed-sign 01 = dsp engine multiplies are unsigned 00 = dsp engine multiplies are signed bit 11 edt: early do loop termination control bit ( 1 , 2 ) 1 = terminates executing do loop at end of current loop iteration 0 = no effect bit 10-8 dl<2:0>: do loop nesting level status bits ( 1 ) 111 = 7 do loops are active ? ? ? 001 = 1 do loop is active 000 = 0 do loops are active bit 7 sata: acca saturation enable bit ( 1 ) 1 = accumulator a saturation is enabled 0 = accumulator a saturation is disabled bit 6 satb: accb saturation enable bit ( 1 ) 1 = accumulator b saturation is enabled 0 = accumulator b saturation is disabled bit 5 satdw: data space write from dsp engine saturation enable bit ( 1 ) 1 = data space write saturation is enabled 0 = data space write saturation is disabled bit 4 accsat: accumulator saturation mode select bit ( 1 ) 1 = 9.31 saturation (super saturation) 0 = 1.31 saturation (normal saturation) note 1: this bit is available on dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only. 2: this bit is always read as ? 0 ?. 3: the ipl3 bit is concatenated with the ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level.
? 2011-2013 microchip technology inc. ds70657g-page 41 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 3 ipl3: cpu interrupt priority level status bit 3 ( 3 ) 1 = cpu interrupt priority level is greater than 7 0 = cpu interrupt priority level is 7 or less bit 2 sfa: stack frame active status bit 1 = stack frame is active. w14 and w15 address 0x0000 to 0xffff, regardless of dsrpag and dswpag values 0 = stack frame is not active. w14 and w15 address of eds or base data space bit 1 rnd: rounding mode select bit ( 1 ) 1 = biased (conventional) rounding is enabled 0 = unbiased (convergent) rounding is enabled bit 0 if: integer or fractional multiplier mode select bit ( 1 ) 1 = integer mode is enabled for dsp multiply 0 = fractional mode is enabled for dsp multiply register 3-2: corcon: core control register (continued) note 1: this bit is available on dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only. 2: this bit is always read as ? 0 ?. 3: the ipl3 bit is concatenated with the ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 42 ? 2011-2013 microchip technology inc. 3.8 arithmetic logic unit (alu) the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x alu is 16 bits wide and is capable of addition, subtraction, bit shifts and logic operations. unless otherwise mentioned, arithmetic operations are two?s complement in nature. depending on the operation, the alu can affect the values of the carry (c), zero (z), negative (n), overflow (ov) and digit carry (dc) status bits in the sr register. the c and dc status bits operate as borrow and digit borrow bits, respectively, for subtraction operations. the alu can perform 8-bit or 16-bit operations, depending on the mode of the instruction that is used. data for the alu operation can come from the w register array or data memory, depending on the addressing mode of the instruction. likewise, output data from the alu can be written to the w register array or a data memory location. refer to the ?16-bit mcu and dsc programmer?s reference manual? (ds70157) for information on the sr bits affected by each instruction. the core cpu incorporates hardware support for both multiplication and division. this includes a dedicated hardware multiplier and support hardware for 16-bit divisor division. 3.8.1 multiplier using the high-speed 17-bit x 17-bit multiplier, the alu supports unsigned, signed, or mixed-sign operation in several mcu multiplication modes: ? 16-bit x 16-bit signed ? 16-bit x 16-bit unsigned ? 16-bit signed x 5-bit (literal) unsigned ? 16-bit signed x 16-bit unsigned ? 16-bit unsigned x 5-bit (literal) unsigned ? 16-bit unsigned x 16-bit signed ? 8-bit unsigned x 8-bit unsigned 3.8.2 divider the divide block supports 32-bit/16-bit and 16-bit/16-bit signed and unsigned integer divide operations with the following data sizes: ? 32-bit signed/16-bit signed divide ? 32-bit unsigned/16-bit unsigned divide ? 16-bit signed/16-bit signed divide ? 16-bit unsigned/16-bit unsigned divide the quotient for all divide instructions ends up in w0 and the remainder in w1. 16-bit signed and unsigned div instructions can specify any w register for both the 16-bit divisor (wn) and any w register (aligned) pair (w(m + 1):wm) for the 32-bit dividend. the divide algorithm takes one cycle per bit of divisor, so both 32-bit/16-bit and 16-bit/16-bit instructions take the same number of cycles to execute. 3.9 dsp engine (dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only) the dsp engine consists of a high-speed 17-bit x 17-bit multiplier, a 40-bit barrel shifter and a 40-bit adder/subtracter (with two target accumulators, round and saturation logic). the dsp engine can also perform inherent accumulator- to-accumulator operations that require no additional data. these instructions are add, sub and neg . the dsp engine has options selected through bits in the cpu core control register (corcon), as listed below: ? fractional or integer dsp multiply (if) ? signed, unsigned or mixed-sign dsp multiply (us) ? conventional or convergent rounding (rnd) ? automatic saturation on/off for acca (sata) ? automatic saturation on/off for accb (satb) ? automatic saturation on/off for writes to data memory (satdw) ? accumulator saturation mode selection (accsat) table 3-2: dsp instructions summary instruction algebraic operation acc write back clr a = 0 yes ed a = (x ? y) 2 no edac a = a + (x ? y) 2 no mac a = a + (x ? y) yes mac a = a + x 2 no movsac no change in a yes mpy a = x ? y no mpy a = x 2 no mpy.n a = ? x ? y no msc a = a ? x ? y yes
? 2011-2013 microchip technology inc. ds70657g-page 43 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.0 memory organization the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x architecture features separate program and data memory spaces, and buses. this architecture also allows the direct access of program memory from the data space (ds) during code execution. 4.1 program address space the program address memory space of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices is 4m instructions. the space is addressable by a 24-bit value derived either from the 23-bit pc during program execution, or from table operation or data space remapping as described in section 4.8 ?interfacing program and data memory spaces? . user application access to the program memory space is restricted to the lower half of the address range (0x000000 to 0x7fffff). the exception is the use of tblrd operations, which use tblpag<7> to read device id sections of the configuration memory space. the program memory maps, which are presented by device family and memory size, are shown in figure 4-1 through figure 4-5 . figure 4-1: program memory map for dspi c33ep32gp50x, dspic33ep32mc20x/50x and pic24ep32gp/mc20x devices note: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 4. ?program memory? (ds70613) of the ? dspic33e/ pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). reset address 0x000000 0x000002 write latches user program flash memory 0x0057ec 0x0057ea (11k instructions) 0x800000 0xfa0000 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x005800 0x0057fe reserved 0xff0002 note: memory areas are not shown to scale. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 44 ? 2011-2013 microchip technology inc. figure 4-2: program memory map for dspi c33ep64gp50x, dspic33ep64mc20x/50x and pic24ep64gp/mc20x devices reset address 0x000000 0x000002 write latches user program flash memory 0x00afec 0x00afea (22k instructions) 0x800000 0xfa0000 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x00b000 0x00affe reserved 0xff0002 note: memory areas are not shown to scale. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
? 2011-2013 microchip technology inc. ds70657g-page 45 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 4-3: program memory map for dspic33ep128gp50x, dspic33ep128mc20x/50x and pic24ep128gp/mc20x devices reset address 0x000000 0x000002 write latches user program flash memory 0x0157ec 0x0157ea (44k instructions) 0x800000 0xfa0000 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x015800 0x0157fe reserved 0xff0002 note: memory areas are not shown to scale. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 46 ? 2011-2013 microchip technology inc. figure 4-4: program memory map for dspic33ep256gp50x, dspic33ep256mc20x/50x and pic24ep256gp/mc20x devices reset address 0x000000 0x000002 write latches user program flash memory 0x02afec 0x02afea (88k instructions) 0x800000 0xfa0000 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x02b000 0x02affe reserved 0xff0002 note: memory areas are not shown to scale. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
? 2011-2013 microchip technology inc. ds70657g-page 47 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 4-5: program memory map for dspic33ep512gp50x, dspic33ep512mc20x/50x and pic24ep512gp/mc20x devices reset address 0x000000 0x000002 write latches user program flash memory 0x0557ec 0x0557ea (175k instructions) 0x800000 0xfa0000 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x055800 0x0557fe reserved 0xff0002 note: memory areas are not shown to scale. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 48 ? 2011-2013 microchip technology inc. 4.1.1 program memory organization the program memory space is organized in word- addressable blocks. although it is treated as 24 bits wide, it is more appropriate to think of each address of the program memory as a lower and upper word, with the upper byte of the upper word being unimplemented. the lower word always has an even address, while the upper word has an odd address ( figure 4-6 ). program memory addresses are always word-aligned on the lower word, and addresses are incremented, or decremented by two, during code execution. this arrangement provides compatibility with data memory space addressing and makes data in the program memory space accessible. 4.1.2 interrupt and trap vectors all dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices reserve the addresses between 0x000000 and 0x000200 for hard- coded program execution vectors. a hardware reset vector is provided to redirect code execution from the default value of the pc on device reset to the actual start of code. a goto instruction is programmed by the user application at address 0x000000 of flash memory, with the actual address for the start of code at address 0x000002 of flash memory. a more detailed discussion of the interrupt vector tables (ivts) is provided in section 7.1 ?interrupt vector table? . figure 4-6: program memory organization 0 8 16 pc address 0x000000 0x000002 0x000004 0x000006 23 00000000 00000000 00000000 00000000 program memory ?phantom? byte (read as ? 0 ?) least significant word most significant word instruction width 0x000001 0x000003 0x000005 0x000007 msw address (lsw address)
? 2011-2013 microchip technology inc. ds70657g-page 49 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.2 data address space the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x cpu has a separate 16-bit-wide data memory space. the data space is accessed using separate address generation units (agus) for read and write operations. the data memory maps, which are presented by device family and memory size, are shown in figure 4-7 through figure 4-16 . all effective addresses (eas) in the data memory space are 16 bits wide and point to bytes within the data space. this arrangement gives a base data space address range of 64 kbytes (32k words). the base data space address is used in conjunction with a read or write page register (dsrpag or dswpag) to form an extended data space, which has a total address range of 16 mbytes. dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices implement up to 52 kbytes of data memory (4 kbytes of data memory for special function registers and up to 48k of data memory for ram). if an ea points to a location outside of this area, an all-zero word or byte is returned. 4.2.1 data space width the data memory space is organized in byte- addressable, 16-bit wide blocks. data is aligned in data memory and registers as 16-bit words, but all data space eas resolve to bytes. the least significant bytes (lsbs) of each word have even addresses, while the most significant bytes (msbs) have odd addresses. 4.2.2 data memory organization and alignment to maintain backward compatibility with pic ? mcu devices and improve data space memory usage efficiency, the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/ mc20x instruction set supports both word and byte operations. as a consequence of byte accessibility, all effective address calculations are internally scaled to step through word-aligned memory. for example, the core recognizes that post-modified register indirect addressing mode [ws++] results in a value of ws + 1 for byte operations and ws + 2 for word operations. a data byte read, reads the complete word that contains the byte, using the lsb of any ea to determine which byte to select. the selected byte is placed onto the lsb of the data path. that is, data memory and registers are organized as two parallel, byte-wide entities with shared (word) address decode but separate write lines. data byte writes only write to the corresponding side of the array or register that matches the byte address. all word accesses must be aligned to an even address. misaligned word data fetches are not supported, so care must be taken when mixing byte and word operations, or translating from 8-bit mcu code. if a misaligned read or write is attempted, an address error trap is generated. if the error occurred on a read, the instruction underway is completed. if the error occurred on a write, the instruction is executed but the write does not occur. in either case, a trap is then executed, allowing the system and/or user application to examine the machine state prior to execution of the address fault. all byte loads into any w register are loaded into the lsb. the msb is not modified. a sign-extend ( se ) instruction is provided to allow user applications to translate 8-bit signed data to 16-bit signed values. alternatively, for 16-bit unsigned data, user applications can clear the msb of any w register by executing a zero-extend ( ze ) instruction on the appropriate address. 4.2.3 sfr space the first 4 kbytes of the near data space, from 0x0000 to 0x0fff, is primarily occupied by special function registers (sfrs). these are used by the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x core and peripheral modules for controlling the operation of the device. sfrs are distributed among the modules that they control, and are generally grouped together by module. much of the sfr space contains unused addresses; these are read as ? 0 ?. 4.2.4 near data space the 8-kbyte area, between 0x0000 and 0x1fff, is referred to as the near data space. locations in this space are directly addressable through a 13-bit abso- lute address field within all memory direct instructions. additionally, the whole data space is addressable using mov instructions, which support memory direct addressing mode with a 16-bit address field, or by using indirect addressing mode using a working register as an address pointer. note: the actual set of peripheral features and interrupts varies by the device. refer to the corresponding device tables and pinout diagrams for device-specific information.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 50 ? 2011-2013 microchip technology inc. figure 4-7: data memory map for dspic33ep32mc20x/50x and dspic33ep32gp50x devices 0x0000 0x0ffe 0x17fe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x17ff 0xffff optionally mapped into program memory space 0x1fff 0x1ffe 0x1001 0x1000 0x1801 0x1800 4-kbyte sfr space 4-kbyte sram space 0x2000 0x2001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv) y data ram (y)
? 2011-2013 microchip technology inc. ds70657g-page 51 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 4-8: data memory map for dspic33ep64mc20x/50x and dspic33ep64gp50x devices 0x0000 0x0ffe 0x1ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x1fff 0xffff optionally mapped into program memory space 0x2fff 0x2ffe 0x1001 0x1000 0x2001 0x2000 4-kbyte sfr space 8-kbyte sram space 0x3000 0x3001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv) y data ram (y)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 52 ? 2011-2013 microchip technology inc. figure 4-9: data memory map for dspic33ep128mc20x/50x and dspic33ep128gp50x devices 0x0000 0x0ffe 0x2ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x2fff 0xffff optionally mapped into program memory space 0x4fff 0x4ffe 0x1001 0x1000 0x3001 0x3000 4-kbyte sfr space 16-kbyte sram space 0x5000 0x5001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv) 0x1ffe 0x1fff 0x2001 0x2000 y data ram (y)
? 2011-2013 microchip technology inc. ds70657g-page 53 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 4-10: data memory map for dspic33ep256mc20x/50x and dspic33ep256gp50x devices 0x0000 0x0ffe 0x4ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x4fff 0xffff optionally mapped into program memory space 0x8fff 0x8ffe 0x1001 0x1000 0x5001 0x5000 4-kbyte sfr space 32-kbyte sram space 0x9000 0x9001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) y data ram (y) note: memory areas are not shown to scale. (psv) 0x1ffe 0x1fff 0x2001 0x2000 0x7ffe 0x7fff 0x8001 0x8000
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 54 ? 2011-2013 microchip technology inc. figure 4-11: data memory map for dspic33ep512mc20x/50x and dspic33ep512gp50x devices 0x0000 0x0ffe 0x7ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x7fff 0xffff optionally mapped into program memory space 0xefff 0xeffe 0x1001 0x1000 0x8001 0x8000 4-kbyte sfr space 48-kbyte sram space 0xd000 0xd001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) note: memory areas are not shown to scale. (psv) 0x1ffe 0x1fff 0x2001 0x2000 0x8ffe 0x8fff 0x9001 0x9000 y data ram (y)
? 2011-2013 microchip technology inc. ds70657g-page 55 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 4-12: data memory map for pic24ep32gp/mc20x/50x devices 0x0000 0x0ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0xffff optionally mapped into program memory space 0x1fff 0x1ffe 0x1001 0x1000 4-kbyte sfr space 4-kbyte sram space 0x2000 0x2001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 56 ? 2011-2013 microchip technology inc. figure 4-13: data memory map for pic24ep64gp/mc20x/50x devices 0x0000 0x0ffe 0x1ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x1fff 0xffff optionally mapped into program memory space 0x2fff 0x2ffe 0x1001 0x1000 0x2001 0x2000 4-kbyte sfr space 8-kbyte sram space 0x3000 0x3001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv)
? 2011-2013 microchip technology inc. ds70657g-page 57 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 4-14: data memory map for pic24ep128gp/mc20x/50x devices 0x0000 0x0ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0xffff optionally mapped into program memory space 0x4fff 0x4ffe 0x1001 0x1000 4-kbyte sfr space 16-kbyte sram space 0x5000 0x5001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv) 0x1ffe 0x1fff 0x2001 0x2000
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 58 ? 2011-2013 microchip technology inc. figure 4-15: data memory map for pic24ep256gp/mc20x/50x devices 0x0000 0x0ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0xffff optionally mapped into program memory space 0x8fff 0x8ffe 0x1001 0x1000 4-kbyte sfr space 32-kbyte sram space 0x9000 0x9001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) note: memory areas are not shown to scale. (psv) 0x1ffe 0x1fff 0x2001 0x2000 0x7ffe 0x7fff 0x8001 0x8000
? 2011-2013 microchip technology inc. ds70657g-page 59 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 4-16: data memory map for pic24ep512gp/mc20x/50x devices 0x0000 0x0ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0xffff optionally mapped into program memory space 0xefff 0xeffe 0x1001 0x1000 4-kbyte sfr space 48-kbyte sram space 0xd000 0xd001 data space near 8-kbyte sfr space x data ram (x) x data unimplemented (x) note: memory areas are not shown to scale. (psv) 0x1ffe 0x1fff 0x2001 0x2000 0x7ffe 0x7fff 0x8001 0x8000
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 60 ? 2011-2013 microchip technology inc. 4.2.5 x and y data spaces the dspic33epxxxmc20x/50x and dspic33epxxxgp50x core has two data spaces, x and y. these data spaces can be considered either separate (for some dsp instructions) or as one unified linear address range (for mcu instructions). the data spaces are accessed using two address generation units (agus) and separate data paths. this feature allows certain instructions to concurrently fetch two words from ram, thereby enabling efficient execution of dsp algorithms, such as finite impulse response (fir) filtering and fast fourier transform (fft). the x data space is used by all instructions and supports all addressing modes. x data space has separate read and write data buses. the x read data bus is the read data path for all instructions that view data space as combined x and y address space. it is also the x data prefetch path for the dual operand dsp instructions ( mac class). the y data space is used in concert with the x data space by the mac class of instructions ( clr , ed , edac , mac , movsac , mpy , mpy.n and msc ) to provide two concurrent data read paths. both the x and y data spaces support modulo addressing mode for all instructions, subject to addressing mode restrictions. bit-reversed addressing mode is only supported for writes to x data space. modulo addressing and bit-reversed addressing are not present in pic24epxxxgp/mc20x devices. all data memory writes, including in dsp instructions, view data space as combined x and y address space. the boundary between the x and y data spaces is device-dependent and is not user-programmable. 4.3 memory resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 4.3.1 key resources ? section 4. ?program memory? (ds70613) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 61 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.4 special function register maps table 4-1: cpu core register map for dspic33ep xxxmc20x/50x and dspic33epxxxgp50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets w0 0000 w0 (wreg) xxxx w1 0002 w1 xxxx w2 0004 w2 xxxx w3 0006 w3 xxxx w4 0008 w4 xxxx w5 000a w5 xxxx w6 000c w6 xxxx w7 000e w7 xxxx w8 0010 w8 xxxx w9 0012 w9 xxxx w10 0014 w10 xxxx w11 0016 w11 xxxx w12 0018 w12 xxxx w13 001a w13 xxxx w14 001c w14 xxxx w15 001e w15 xxxx splim 0020 splim 0000 accal 0022 accal 0000 accah 0024 accah 0000 accau 0026 sign extension of acca<39> accau 0000 accbl 0028 accbl 0000 accbh 002a accbh 0000 accbu 002c sign extension of accb<39> accbu 0000 pcl 002e pcl<15:0> ? 0000 pch 0030 ? ? ? ? ? ? ? ? ? pch<6:0> 0000 dsrpag 0032 ? ? ? ? ? ?dsrpag<9:0> 0001 dswpag 0034 ? ? ? ? ? ? ? dswpag<8:0> 0001 rcount 0036 rcount<15:0> 0000 dcount 0038 dcount<15:0> 0000 dostartl 003a dostartl<15:1> ? 0000 dostarth 003c ? ? ? ? ? ? ? ? ? ?dostarth<5:0> 0000 doendl 003e doendl<15:1> ? 0000 doendh 0040 ? ? ? ? ? ? ? ? ? ? doendh<5:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 62 ? 2011-2013 microchip technology inc. sr 0042 oa ob sa sb oab sab da dc ipl2 ipl1 ipl0 ra n ov z c 0000 corcon 0044 var ? us<1:0> edt dl<2:0> sata satb satdw accsat ipl3 sfa rnd if 0020 modcon 0046 xmoden ymoden ? ? bwm<3:0> ywm<3:0> xwm<3:0> 0000 xmodsrt 0048 xmodsrt<15:0> ? 0000 xmodend 004a xmodend<15:0> ? 0001 ymodsrt 004c ymodsrt<15:0> ? 0000 ymodend 004e ymodend<15:0> ? 0001 xbrev 0050 bren xbrev<14:0> 0000 disicnt 0052 ? ? disicnt<13:0> 0000 tblpag 0054 ? ? ? ? ? ? ? ?tblpag<7:0> 0000 mstrpr 0058 mstrpr<15:0> 0000 table 4-1: cpu core register map for dspic33epxxxmc20x /50x and dspic33epxxxgp50x devices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 63 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-2: cpu core register map for pic24epxxxgp/mc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets w0 0000 w0 (wreg) xxxx w1 0002 w1 xxxx w2 0004 w2 xxxx w3 0006 w3 xxxx w4 0008 w4 xxxx w5 000a w5 xxxx w6 000c w6 xxxx w7 000e w7 xxxx w8 0010 w8 xxxx w9 0012 w9 xxxx w10 0014 w10 xxxx w11 0016 w11 xxxx w12 0018 w12 xxxx w13 001a w13 xxxx w14 001c w14 xxxx w15 001e w15 xxxx splim 0020 splim<15:0> 0000 pcl 002e pcl<15:1> ? 0000 pch 0030 ? ? ? ? ? ? ? ? ? pch<6:0> 0000 dsrpag 0032 ? ? ? ? ? ?dsrpag<9:0> 0001 dswpag 0034 ? ? ? ? ? ? ?dswpag<8:0> 0001 rcount 0036 rcount<15:0> 0000 sr 0042 ? ? ? ? ? ? ? dc ipl2 ipl1 ipl0 ra n ov z c 0000 corcon 0044 var ? ? ? ? ? ? ? ? ? ? ?ipl3sfa ? ? 0020 disicnt 0052 ? ? disicnt<13:0> 0000 tblpag 0054 ? ? ? ? ? ? ? ?tblpag<7:0> 0000 mstrpr 0058 mstrpr<15:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 64 ? 2011-2013 microchip technology inc. table 4-3: interrupt controller register map for pic24epxxxgp20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if ? ? spi2if spi2eif 0000 ifs3 0806 ? ? ? ? ? ? ? ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ? ? ? ? crcif u2eif u1eif ? 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie ? ? spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? ? ? ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ? ? ? ? crcie u2eie u1eie ? 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ? oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ? oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ? spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ? ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ? cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ? oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? ? ? ? ? ? ? ? ? spi2ip<2:0> ? spi2eip<2:0> 0044 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ? u1eip<2:0> ? ? ? ? 4440 ipc19 0866 ? ? ? ? ? ? ? ? ? ctmuip<2:0> ? ? ? ? 0040 ipc35 0886 ? jtagip<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 ipc36 0888 ? ptg0ip<2:0> ? ptgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 intcon1 08c0 nstdis ovaerr ovberr ? ? ? ? ? ? div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 65 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-4: interrupt controller register map for pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if ? ? spi2if spi2eif 0000 ifs3 0806 ? ? ? ? ? qei1if psemif ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ? ? ? ? crcif u2eif u1eif ? 0000 ifs5 080a pwm2if pwm1if ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs6 080c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3if 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie ? ? spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? qei1ie psemie ? ? ? ? ? ?mi2c2iesi2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ? ? ? ? crcie u2eie u1eie ? 0000 iec5 082a pwm2ie pwm1ie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec6 082c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3ie 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ? oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ? oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ? spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ? ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ? cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ? oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? ? ? ? ? ? ? ? ? spi2ip<2:0> ? spi2eip<2:0> 0044 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc14 085c ? ? ? ? ? qei1ip<2:0> ? psemip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ? u1eip<2:0> ? ? ? ? 4440 ipc19 0866 ? ? ? ? ? ? ? ? ? ctmuip<2:0> ? ? ? ? 0040 ipc23 086e ? pwm2ip<2:0> ? pwm1ip<2:0> ? ? ? ? ? ? ? ? 4400 ipc24 0870 ? ? ? ? ? ? ? ? ? ? ? ? ? pwm3ip<2:0> 4004 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 66 ? 2011-2013 microchip technology inc. ipc35 0886 ? jtagip<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 ipc36 0888 ? ptg0ip<2:0> ? ptgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 intcon1 08c0 nstdis ovaerr ovberr ? ? ? ? ? ? div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-4: interrupt controller register map for pic24epxxxmc20x devices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 67 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-5: interrupt controller register map for dspic33epxxxgp50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if c1if c1rxif spi2if spi2eif 0000 ifs3 0806 ? ? ? ? ? ? ? ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ?c1txif ? ? crcif u2eif u1eif ? 0000 ifs6 080c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3if 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie c1ie c1rxie spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? ? ? ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ?c1txie ? ? crcie u2eie u1eie ? 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ? oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ? oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ? spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ? ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ?cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ? oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? c1ip<2:0> ? c1rxip<2:0> ? spi2ip<2:0> ? spi2eip<2:0> 4444 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc11 0856 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ?u2eip<2:0> ? u1eip<2:0> ? ? ? ? 4440 ipc17 0862 ? ? ? ? ? c1txip<2:0> ? ? ? ? ? ? ? ? 0400 ipc19 0866 ? ? ? ? ? ? ? ? ?ctmuip<2:0> ? ? ? ? 0040 ipc35 0886 ? jtagip<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 ipc36 0888 ? ptg0ip<2:0> ? ptgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 68 ? 2011-2013 microchip technology inc. intcon1 08c0 nstdis ovaerr ovberr covaerr covberr ovate ovbte covte sftacerr div0err dmacerr matherr a ddrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-5: interrupt controller register map fo r dspic33epxxxgp50x devices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 69 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-6: interrupt controller register map for dspic33epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if ? ? spi2if spi2eif 0000 ifs3 0806 ? ? ? ? ? qei1if psemif ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ? ? ? ? crcif u2eif u1eif ? 0000 ifs5 080a pwm2if pwm1if ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs6 080c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3if 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie ? ? spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? qei1ie psemie ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ? ? ? ? crcie u2eie u1eie ? 0000 iec5 082a pwm2ie pwm1ie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec6 082c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3ie 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ? oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ? oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ? spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ? ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ? cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ? oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? ? ? ? ? c1rxip<2:0> ? spi2ip<2:0> ? spi2eip<2:0> 0444 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc14 085c ? ? ? ? ? qei1ip<2:0> ? psemip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ? u1eip<2:0> ? ? ? ? 4440 ipc19 0866 ? ? ? ? ? ? ? ? ? ctmuip<2:0> ? ? ? ? 0040 ipc23 086e ? pwm2ip<2:0> ? pwm1ip<2:0> ? ? ? ? ? ? ? ? 4400 ipc24 0870 ? ? ? ? ? ? ? ? ? ? ? ? ? pwm3ip<2:0> 0004 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 70 ? 2011-2013 microchip technology inc. ipc35 0886 ? jtagip<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 ipc36 0888 ? ptg0ip<2:0> ? ptgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 intcon1 08c0 nstdis ovaerr ovberr covaerr covberr ovate ovbte covte sftacerr div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-6: interrupt controller register map for dspic33epxxxmc20x devices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 71 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-7: interrupt controller register map for dspic33epxxxmc50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if c1if c1rxif spi2if spi2eif 0000 ifs3 0806 ? ? ? ? ? qei1if psemif ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ?c1txif ? ? crcif u2eif u1eif ? 0000 ifs5 080a pwm2if pwm1if ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs6 080c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3if 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie c1ie c1rxie spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? qei1ie psemie ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ?c1txie ? ? crcie u2eie u1eie ? 0000 iec5 082a pwm2ie pwm1ie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec6 082c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3ie 0000 iec7 082e ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ?oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ?oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ? spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ? ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ? cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ?oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? c1ip<2:0> ? c1rxip<2:0> ? spi2ip<2:0> ?spi2eip<2:0> 4444 ipc9 0852 ? ? ? ? ?ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc14 085c ? ? ? ? ? qei1ip<2:0> ? psemip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ? u1eip<2:0> ? ? ? ? 4440 ipc17 0862 ? ? ? ? ? c1txip<2:0> ? ? ? ? ? ? ? ? 0400 ipc19 0866 ? ? ? ? ? ? ? ? ?ctmuip<2:0> ? ? ? ? 0040 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 72 ? 2011-2013 microchip technology inc. ipc23 086e ? pwm2ip<2:0> ? pwm1ip<2:0> ? ? ? ? ? ? ? ? 4400 ipc24 0870 ? ? ? ? ? ? ? ? ? ? ? ? ? pwm3ip<2:0> 0004 ipc35 0886 ? jtagip<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 ipc36 0888 ? ptg0ip<2:0> ? ptgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ?ptg1ip<2:0> 0444 intcon1 08c0 nstdis ovaerr ovberr covaerr covberr ovate ovbte covte sftacerr div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ? dae doovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-7: interrupt controller register map for dspic33epxxxmc50x devices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 73 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-8: timer1 through timer5 register map sfr name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets tmr1 0100 timer1 register xxxx pr1 0102 period register 1 ffff t1con 0104 ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> ? tsync tcs ? 0000 tmr2 0106 timer2 register xxxx tmr3hld 0108 timer3 holding register (for 32-bit timer operations only) xxxx tmr3 010a timer3 register xxxx pr2 010c period register 2 ffff pr3 010e period register 3 ffff t2con 0110 ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> t32 ?tcs ? 0000 t3con 0112 ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> ? ?tcs ? 0000 tmr4 0114 timer4 register xxxx tmr5hld 0116 timer5 holding register (for 32-bit operations only) xxxx tmr5 0118 timer5 register xxxx pr4 011a period register 4 ffff pr5 011c period register 5 ffff t4con 011e ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> t32 ?tcs ? 0000 t5con 0120 ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> ? ?tcs ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 74 ? 2011-2013 microchip technology inc. table 4-9: input capture 1 throug h input capture 4 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ic1con1 0140 ? ? icsidl ictsel<2:0> ? ? ? ici<1:0> icov icbne icm<2:0> 0000 ic1con2 0142 ? ? ? ? ? ? ? ic32 ictrig trigstat ?syncsel<4:0> 000d ic1buf 0144 input capture 1 buffer register xxxx ic1tmr 0146 input capture 1 timer 0000 ic2con1 0148 ? ? icsidl ictsel<2:0> ? ? ? ici<1:0> icov icbne icm<2:0> 0000 ic2con2 014a ? ? ? ? ? ? ? ic32 ictrig trigstat ?syncsel<4:0> 000d ic2buf 014c input capture 2 buffer register xxxx ic2tmr 014e input capture 2 timer 0000 ic3con1 0150 ? ? icsidl ictsel<2:0> ? ? ? ici<1:0> icov icbne icm<2:0> 0000 ic3con2 0152 ? ? ? ? ? ? ? ic32 ictrig trigstat ?syncsel<4:0> 000d ic3buf 0154 input capture 3 buffer register xxxx ic3tmr 0156 input capture 3 timer 0000 ic4con1 0158 ? ? icsidl ictsel<2:0> ? ? ? ici<1:0> icov icbne icm<2:0> 0000 ic4con2 015a ? ? ? ? ? ? ? ic32 ictrig trigstat ?syncsel<4:0> 000d ic4buf 015c input capture 4 buffer register xxxx ic4tmr 015e input capture 4 timer 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 75 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-10: output compare 1 throug h output compare 4 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets oc1con1 0900 ? ? ocsidl octsel<2:0> ? enfltb enflta ? ocfltb ocflta trigmode ocm<2:0> 0000 oc1con2 0902 fltmd fltout flttrien ocinv ? ? ? oc32 octrig trigstat octris syncsel<4:0> 000c oc1rs 0904 output compare 1 secondary register xxxx oc1r 0906 output compare 1 register xxxx oc1tmr 0908 timer value 1 register xxxx oc2con1 090a ? ? ocsidl octsel<2:0> ? enfltb enflta ? ocfltb ocflta trigmode ocm<2:0> 0000 oc2con2 090c fltmd fltout flttrien ocinv ? ? ? oc32 octrig trigstat octris syncsel<4:0> 000c oc2rs 090e output compare 2 secondary register xxxx oc2r 0910 output compare 2 register xxxx oc2tmr 0912 timer value 2 register xxxx oc3con1 0914 ? ? ocsidl octsel<2:0> ? enfltb enflta ? ocfltb ocflta trigmode ocm<2:0> 0000 oc3con2 0916 fltmd fltout flttrien ocinv ? ? ? oc32 octrig trigstat octris syncsel<4:0> 000c oc3rs 0918 output compare 3 secondary register xxxx oc3r 091a output compare 3 register xxxx oc3tmr 091c timer value 3 register xxxx oc4con1 091e ? ? ocsidl octsel<2:0> enfltc enfltb enflta ocfltc ocfltb ocflta trigmode ocm<2:0> 0000 oc4con2 0920 fltmd fltout flttrien ocinv ? ? ? oc32 octrig trigstat octris syncsel<4:0> 000c oc4rs 0922 output compare 4 secondary register xxxx oc4r 0924 output compare 4 register xxxx oc4tmr 0926 timer value 4 register xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 76 ? 2011-2013 microchip technology inc. table 4-11: ptg register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ptgcst 0ac0 ptgen ? ptgsidl ptgtogl ? ptgswt ptgssen ptgivis ptgstrt ptgwto ? ? ? ?ptgitm<1:0> 0000 ptgcon 0ac2 ptgclk<2:0> ptgdiv<4:0> ptgpwd<3:0> ? ptgwdt<2:0> 0000 ptgbte 0ac4 adcts<4:1> ic4tss ic3tss ic2tss ic1tss oc4cs oc3cs oc2cs oc1cs oc4tss oc3tss oc2tss oc1tss 0000 ptghold 0ac6 ptghold<15:0> 0000 ptgt0lim 0ac8 ptgt0lim<15:0> 0000 ptgt1lim 0aca ptgt1lim<15:0> 0000 ptgsdlim 0acc ptgsdlim<15:0> 0000 ptgc0lim 0ace ptgc0lim<15:0> 0000 ptgc1lim 0ad0 ptgc1lim<15:0> 0000 ptgadj 0ad2 ptgadj<15:0> 0000 ptgl0 0ad4 ptgl0<15:0> 0000 ptgqptr 0ad6 ? ? ? ? ? ? ? ? ? ? ? ptgqptr<4:0> 0000 ptgque0 0ad8 step1<7:0> step0<7:0> 0000 ptgque1 0ada step3<7:0> step2<7:0> 0000 ptgque2 0adc step5<7:0> step4<7:0> 0000 ptgque3 0ade step7<7:0> step6<7:0> 0000 ptgque4 0ae0 step9<7:0> step8<7:0> 0000 ptgque5 0ae2 step11<7:0> step10<7:0> 0000 ptgque6 0ae4 step13<7:0> step12<7:0> 0000 ptgque7 0ae6 step15<7:0> step14<7:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 77 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-12: pwm register map for dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ptcon 0c00 pten ? ptsidl sestat seien eipu syncpol syncoen syncen syncsrc<2:0> sevtps<3:0> 0000 ptcon2 0c02 ? ? ? ? ? ? ? ? ? ? ? ? ? pclkdiv<2:0> 0000 ptper 0c04 ptper<15:0> 00f8 sevtcmp 0c06 sevtcmp<15:0> 0000 mdc 0c0a mdc<15:0> 0000 chop 0c1a chpclken ? ? ? ? ? chopclk<9:0> 0000 pwmkey 0c1e pwmkey<15:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-13: pwm generator 1 register map for dspi c33epxxxmc20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pwmcon1 0c20 fltstat clstat trgstat fltien clien trgien itb mdcs dtc<1:0> dtcp ? mtbs cam xpres iue 0000 iocon1 0c22 penh penl polh poll pmod<1:0> ovrenh ovrenl ovrdat<1:0> fltdat<1:0> cldat<1:0> swap osync c000 fclcon1 0c24 ? clsrc<4:0> clpol clmod fltsrc<4:0> fltpol fltmod<1:0> 0000 pdc1 0c26 pdc1<15:0> fff8 phase1 0c28 phase1<15:0> 0000 dtr1 0c2a ? ? dtr1<13:0> 0000 altdtr1 0c2c ? ? altdtr1<13:0> 0000 trig1 0c32 trgcmp<15:0> 0000 trgcon1 0c34 trgdiv<3:0> ? ? ? ? ? ?trgstrt<5:0> 0000 lebcon1 0c3a phr phf plr plf fltleben clleben ? ? ? ? bch bcl bphh bphl bplh bpll 0000 lebdly1 0c3c ? ? ? ? leb<11:0> 0000 auxcon1 0c3e ? ? ? ? blanksel<3:0> ? ? chopclk<3:0> chophen choplen 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 78 ? 2011-2013 microchip technology inc. table 4-14: pwm generator 2 register map for dspi c33epxxxmc20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pwmcon2 0c40 fltstat clstat trgstat fltien clien trgien itb mdcs dtc<1:0> dtcp ? mtbs cam xpres iue 0000 iocon2 0c42 penh penl polh poll pmod<1:0> ovrenh ovrenl ovrdat<1:0> fltdat<1:0> cldat<1:0> swap osync c000 fclcon2 0c44 ? clsrc<4:0> clpol clmod fltsrc<4:0> fltpol fltmod<1:0> 00f8 pdc2 0c46 pdc2<15:0> 0000 phase2 0c48 phase2<15:0> 0000 dtr2 0c4a ? ? dtr2<13:0> 0000 altdtr2 0c4c ? ? altdtr2<13:0> 0000 trig2 0c52 trgcmp<15:0> 0000 trgcon2 0c54 trgdiv<3:0> ? ? ? ? ? ?trgstrt<5:0> 0000 lebcon2 0c5a phr phf plr plf fltleben clleben ? ? ? ? bch bcl bphh bphl bplh bpll 0000 lebdly2 0c5c ? ? ? ? leb<11:0> 0000 auxcon2 0c5e ? ? ? ? blanksel<3:0> ? ? chopsel<3:0> chophen choplen 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-15: pwm generator 3 register map for dspi c33epxxxmc20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pwmcon3 0c60 fltstat clstat trgstat fltien clien trgien itb mdcs dtc<1:0> dtcp ? mtbs cam xpres iue 0000 iocon3 0c62 penh penl polh poll pmod<1:0> ovrenh ovrenl ovrdat<1:0> fltdat<1:0> cldat<1:0> swap osync c000 fclcon3 0c64 ? clsrc<4:0> clpol clmod fltsrc<4:0> fltpol fltmod<1:0> 00f8 pdc3 0c66 pdc3<15:0> 0000 phase3 0c68 phase3<15:0> 0000 dtr3 0c6a ? ? dtr3<13:0> 0000 altdtr3 0c6c ? ? altdtr3<13:0> 0000 trig3 0c72 trgcmp<15:0> 0000 trgcon3 0c74 trgdiv<3:0> ? ? ? ? ? ?trgstrt<5:0> 0000 lebcon3 0c7a phr phf plr plf fltleben clleben ? ? ? ? bch bcl bphh bphl bplh bpll 0000 lebdly3 0c7c ? ? ? ?leb<11:0> 0000 auxcon3 0c7e ? ? ? ? blanksel<3:0> ? ? chopsel<3:0> chophen choplen 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 79 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-16: qei1 register map for dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets qei1con 01c0 qeien ? qeisidl pimod<2:0> imv<1:0> ? intdiv<2:0> cntpol gaten ccm<1:0> 0000 qei1ioc 01c2 qcapen fltren qfdiv<2:0> outfnc<1:0> swpab hompol idxpol qebpol qeapol home index qeb qea 000x qei1stat 01c4 ? ? pcheqirq pcheqien pcleqirq pcleqien posovirq posovien pciirq pciien velovirq velovien homirq homien idxirq idxien 0000 pos1cntl 01c6 poscnt<15:0> 0000 pos1cnth 01c8 poscnt<31:16> 0000 pos1hld 01ca poshld<15:0> 0000 vel1cnt 01cc velcnt<15:0> 0000 int1tmrl 01ce inttmr<15:0> 0000 int1tmrh 01d0 inttmr<31:16> 0000 int1hldl 01d2 inthld<15:0> 0000 int1hldh 01d4 inthld<31:16> 0000 indx1cntl 01d6 indxcnt<15:0> 0000 indx1cnth 01d8 indxcnt<31:16> 0000 indx1hld 01da indxhld<15:0> 0000 qei1gecl 01dc qeigec<15:0> 0000 qei1icl 01dc qeiic<15:0> 0000 qei1gech 01de qeigec<31:16> 0000 qei1ich 01de qeiic<31:16> 0000 qei1lecl 01e0 qeilec<15:0> 0000 qei1lech 01e2 qeilec<31:16> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 80 ? 2011-2013 microchip technology inc. table 4-17: i2c1 and i2c2 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets i2c1rcv 0200 ? ? ? ? ? ? ? ? i2c1 receive register 0000 i2c1trn 0202 ? ? ? ? ? ? ? ? i2c1 transmit register 00ff i2c1brg 0204 ? ? ? ? ? ? ? baud rate generator 0000 i2c1con 0206 i2cen ? i2csidl sclrel ipmien a10m disslw smen gcen stren ackdt acken rcen pen rsen sen 1000 i2c1stat 0208 ackstat trstat ? ? ? bcl gcstat add10 iwcol i2cov d_a p s r_w rbf tbf 0000 i2c1add 020a ? ? ? ? ? ? i2c1 address register 0000 i2c1msk 020c ? ? ? ? ? ? i2c1 address mask 0000 i2c2rcv 0210 ? ? ? ? ? ? ? ? i2c2 receive register 0000 i2c2trn 0212 ? ? ? ? ? ? ? ? i2c2 transmit register 00ff i2c2brg 0214 ? ? ? ? ? ? ? baud rate generator 0000 i2c2con 0216 i2cen ? i2csidl sclrel ipmien a10m disslw smen gcen stren ackdt acken rcen pen rsen sen 1000 i2c2stat 0218 ackstat trstat ? ? ? bcl gcstat add10 iwcol i2cov d_a p s r_w rbf tbf 0000 i2c2add 021a ? ? ? ? ? ? i2c2 address register 0000 i2c2msk 021c ? ? ? ? ? ? i2c2 address mask 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-18: uart1 and uart2 register map sfr name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets u1mode 0220 uarten ? usidl iren rtsmd ? uen<1:0> wake lpback abaud urxinv brgh pdsel<1:0> stsel 0000 u1sta 0222 utxisel1 utxinv utxisel0 ? utxbrk utxen utxbf trmt urxisel<1:0> adden ridle perr ferr oerr urxda 0110 u1txreg 0224 ? ? ? ? ? ? ? uart1 transmit register xxxx u1rxreg 0226 ? ? ? ? ? ? ? uart1 receive register 0000 u1brg 0228 baud rate generator prescaler 0000 u2mode 0230 uarten ? usidl iren rtsmd ? uen<1:0> wake lpback abaud urxinv brgh pdsel<1:0> stsel 0000 u2sta 0232 utxisel1 utxinv utxisel0 ? utxbrk utxen utxbf trmt urxisel<1:0> adden ridle perr ferr oerr urxda 0110 u2txreg 0234 ? ? ? ? ? ? ? uart2 transmit register xxxx u2rxreg 0236 ? ? ? ? ? ? ? uart2 receive register 0000 u2brg 0238 baud rate generator prescaler 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 81 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-19: spi1 and spi2 register map sfr name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets spi1stat 0240 spien ? spisidl ? ? spibec<2:0> srmpt spirov srxmpt sisel<2:0> spitbf spirbf 0000 spi1con1 0242 ? ? ? dissck dissdo mode16 smp cke ssen ckp msten spre<2:0> ppre<1:0> 0000 spi1con2 0244 frmen spifsd frmpol ? ? ? ? ? ? ? ? ? ? ? frmdly spiben 0000 spi1buf 0248 spi1 transmit and receive buffer register 0000 spi2stat 0260 spien ? spisidl ? ? spibec<2:0> srmpt spirov srxmpt sisel<2:0> spitbf spirbf 0000 spi2con1 0262 ? ? ? dissck dissdo mode16 smp cke ssen ckp msten spre<2:0> ppre<1:0> 0000 spi2con2 0264 frmen spifsd frmpol ? ? ? ? ? ? ? ? ? ? ? frmdly spiben 0000 spi2buf 0268 spi2 transmit and receive buffer register 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 82 ? 2011-2013 microchip technology inc. table 4-20: adc1 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets adc1buf0 0300 adc1 data buffer 0 xxxx adc1buf1 0302 adc1 data buffer 1 xxxx adc1buf2 0304 adc1 data buffer 2 xxxx adc1buf3 0306 adc1 data buffer 3 xxxx adc1buf4 0308 adc1 data buffer 4 xxxx adc1buf5 030a adc1 data buffer 5 xxxx adc1buf6 030c adc1 data buffer 6 xxxx adc1buf7 030e adc1 data buffer 7 xxxx adc1buf8 0310 adc1 data buffer 8 xxxx adc1buf9 0312 adc1 data buffer 9 xxxx adc1bufa 0314 adc1 data buffer 10 xxxx adc1bufb 0316 adc1 data buffer 11 xxxx adc1bufc 0318 adc1 data buffer 12 xxxx adc1bufd 031a adc1 data buffer 13 xxxx adc1bufe 031c adc1 data buffer 14 xxxx adc1buff 031e adc1 data buffer 15 xxxx ad1con1 0320 adon ? adsidl addmabm ? ad12b form<1:0> ssrc<2:0> ssrcg simsam asam samp done 0000 ad1con2 0322 vcfg<2:0> ? ? cscna chps<1:0> bufs smpi<4:0> bufm alts 0000 ad1con3 0324 adrc ? ? samc<4:0> adcs<7:0> 0000 ad1chs123 0326 ? ? ? ? ? ch123nb<1:0> ch123sb ? ? ? ? ? ch123na<1:0> ch123sa 0000 ad1chs0 0328 ch0nb ? ? ch0sb<4:0> ch0na ? ? ch0sa<4:0> 0000 ad1cssh 032e css31 css30 ? ? ? css26 css25 css24 ? ? ? ? ? ? ? ? 0000 ad1cssl 0330 css15 css14 css13 css12 css11 css10 c ss9 css8 css7 css6 css5 css4 css3 css2 css1 css0 0000 ad1con4 0332 ? ? ? ? ? ? ? addmaen ? ? ? ? ? dmabl<2:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 83 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-21: ecan1 register map when win (c1ctrl<0>) = 0 or 1 for dspic33epxxxmc/gp50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets c1ctrl1 0400 ? ? csidl abat cancks reqop<2:0> opmode<2:0> ?cancap ? ?win 0480 c1ctrl2 0402 ? ? ? ? ? ? ? ? ? ? ? dncnt<4:0> 0000 c1vec 0404 ? ? ?filhit<4:0> ? icode<6:0> 0040 c1fctrl 0406 dmabs<2:0> ? ? ? ? ? ? ? ?fsa<4:0> 0000 c1fifo 0408 ? ?fbp<5:0> ? ? fnrb<5:0> 0000 c1intf 040a ? ? txbo txbp rxbp txwar rxwar ewarn ivrif wakif errif ? fifoif rbovif rbif tbif 0000 c1inte 040c ? ? ? ? ? ? ? ? ivrie wakie errie ? fifoie rbovie rbie tbie 0000 c1ec 040e terrcnt<7:0> rerrcnt<7:0> 0000 c1cfg1 0410 ? ? ? ? ? ? ? ? sjw<1:0> brp<5:0> 0000 c1cfg2 0412 ? wakfil ? ? ? seg2ph<2:0> seg2phts sam seg1ph<2:0> prseg<2:0> 0000 c1fen1 0414 flten15 flten14 flten13 flten12 flten11 flten10 flte n9 flten8 flten7 flten6 flten5 fl ten4 flten3 flten2 flten1 flten0 ffff c1fmsksel1 0418 f7msk<1:0> f6msk<1:0> f5msk<1:0> f4msk<1:0> f3msk<1:0> f2msk<1:0> f1msk<1:0> f0msk<1:0> 0000 c1fmsksel2 041a f15msk<1:0> f14msk<1:0> f13msk<1:0> f12msk<1:0> f11msk<1:0> f10msk<1:0> f9msk<1:0> f8msk<1:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-22: ecan1 register map when win (c1ctrl<0>) = 0 for dspic33epxxxmc/gp50x devices only file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 b it 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets 0400- 041e see definition when win = x c1rxful1 0420 rxful15 rxful14 rxful13 rxful12 rxful11 rxful10 rxful9 rxful8 rxful7 rxful6 rxful5 rxful4 rxful3 rxful2 rxful1 rxful0 0000 c1rxful2 0422 rxful31 rxful30 rxful29 rxful28 rxful27 rxful26 rxful25 rx ful24 rxful23 rxful22 rxful21 rxful20 rxful19 rxful18 rxful17 rxful16 0000 c1rxovf1 0428 rxovf15 rxovf14 rxovf13 rxovf12 rxovf11 rxovf10 rxovf9 rxovf8 rxovf7 rxovf6 rxovf5 rxovf4 rxovf3 rxovf2 rxovf1 rxovf0 0000 c1rxovf2 042a rxovf31 rxovf30 rxovf29 rxovf28 rxovf27 rxovf26 rxovf25 rxovf24 rxovf23 rxovf22 rxovf21 rxovf20 rxovf19 rxovf18 rxovf17 rxovf16 0000 c1tr01con 0430 txen1 txabt1 txlarb1 txerr1 txreq1 rtren1 tx1pri<1 :0> txen0 txabat0 txlarb0 txerr0 txreq0 rtren0 tx0pri<1:0> 0000 c1tr23con 0432 txen3 txabt3 txlarb3 txerr3 txreq3 rtren3 tx3pri<1 :0> txen2 txabat2 txlarb2 txerr2 txreq2 rtren2 tx2pri<1:0> 0000 c1tr45con 0434 txen5 txabt5 txlarb5 txerr5 txreq5 rtren5 tx5pri<1 :0> txen4 txabat4 txlarb4 txerr4 txreq4 rtren4 tx4pri<1:0> 0000 c1tr67con 0436 txen7 txabt7 txlarb7 txerr7 txreq7 rtren7 tx7pri<1 :0> txen6 txabat6 txlarb6 txerr6 txreq6 rtren6 tx6pri<1:0> xxxx c1rxd 0440 ecan1 receive data word xxxx c1txd 0442 ecan1 transmit data word xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 84 ? 2011-2013 microchip technology inc. table 4-23: ecan1 register map when win (c1ctrl<0>) = 1 for dspic33epxxxmc/gp50x devices only file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets 0400- 041e see definition when win = x c1bufpnt1 0420 f3bp<3:0> f2bp<3:0> f1bp<3:0> f0bp<3:0> 0000 c1bufpnt2 0422 f7bp<3:0> f6bp<3:0> f5bp<3:0> f4bp<3:0> 0000 c1bufpnt3 0424 f11bp<3:0> f10bp<3:0> f9bp<3:0> f8bp<3:0> 0000 c1bufpnt4 0426 f15bp<3:0> f14bp<3:0> f13bp<3:0> f12bp<3:0> 0000 c1rxm0sid 0430 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c1rxm0eid 0432 eid<15:8> eid<7:0> xxxx c1rxm1sid 0434 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c1rxm1eid 0436 eid<15:8> eid<7:0> xxxx c1rxm2sid 0438 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c1rxm2eid 043a eid<15:8> eid<7:0> xxxx c1rxf0sid 0440 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf0eid 0442 eid<15:8> eid<7:0> xxxx c1rxf1sid 0444 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf1eid 0446 eid<15:8> eid<7:0> xxxx c1rxf2sid 0448 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf2eid 044a eid<15:8> eid<7:0> xxxx c1rxf3sid 044c sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf3eid 044e eid<15:8> eid<7:0> xxxx c1rxf4sid 0450 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf4eid 0452 eid<15:8> eid<7:0> xxxx c1rxf5sid 0454 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf5eid 0456 eid<15:8> eid<7:0> xxxx c1rxf6sid 0458 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf6eid 045a eid<15:8> eid<7:0> xxxx c1rxf7sid 045c sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf7eid 045e eid<15:8> eid<7:0> xxxx c1rxf8sid 0460 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf8eid 0462 eid<15:8> eid<7:0> xxxx c1rxf9sid 0464 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf9eid 0466 eid<15:8> eid<7:0> xxxx c1rxf10sid 0468 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf10eid 046a eid<15:8> eid<7:0> xxxx c1rxf11sid 046c sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 85 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x c1rxf11eid 046e eid<15:8> eid<7:0> xxxx c1rxf12sid 0470 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf12eid 0472 eid<15:8> eid<7:0> xxxx c1rxf13sid 0474 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf13eid 0476 eid<15:8> eid<7:0> xxxx c1rxf14sid 0478 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf14eid 047a eid<15:8> eid<7:0> xxxx c1rxf15sid 047c sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c1rxf15eid 047e eid<15:8> eid<7:0> xxxx table 4-23: ecan1 register map when win (c1ctrl<0>) = 1 for dspic33epxxxmc/gp50x devices only (continued) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 86 ? 2011-2013 microchip technology inc. table 4-24: crc register map table 4-25: peripheral pin select output register map for dspic33epxxxgp/mc202/502 and pic24epxxxgp/mc202 devices only table 4-26: peripheral pin select output register map for dspic33epxxxgp/mc203/503 and pic24epxxxgp/mc203 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets crccon1 0640 crcen ? csidl vword<4:0> crcful crcmpt crcisel crcgo lendian ? ? ? 0000 crccon2 0642 ? ? ? dwidth<4:0> ? ? ? plen<4:0> 0000 crcxorl 0644 x<15:1> ? 0000 crcxorh 0646 x<31:16> 0000 crcdatl 0648 crc data input low word 0000 crcdath 064a crc data input high word 0000 crcwdatl 064c crc result low word 0000 crcwdath 064e crc result high word 0000 legend: ? = unimplemented, read as ? 0 ?. shaded bits are not used in the operation of the programmable crc module. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0680 ? ?rp35r<5:0> ? ?rp20r<5:0> 0000 rpor1 0682 ? ?rp37r<5:0> ? ?rp36r<5:0> 0000 rpor2 0684 ? ?rp39r<5:0> ? ?rp38r<5:0> 0000 rpor3 0686 ? ?rp41r<5:0> ? ?rp40r<5:0> 0000 rpor4 0688 ? ?rp43r<5:0> ? ?rp42r<5:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0680 ? ?rp35r<5:0> ? ?rp20r<5:0> 0000 rpor1 0682 ? ?rp37r<5:0> ? ?rp36r<5:0> 0000 rpor2 0684 ? ?rp39r<5:0> ? ?rp38r<5:0> 0000 rpor3 0686 ? ?rp41r<5:0> ? ?rp40r<5:0> 0000 rpor4 0688 ? ?rp43r<5:0> ? ?rp42r<5:0> 0000 rpor5 068a ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 rpor6 068c ? ? ? ? ? ? ? ? ? ?rp56r<5:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 87 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-27: peripheral pin select output register map for dspic33epxxxgp/mc204/504 and pic24epxxxgp/mc204 devices only table 4-28: peripheral pin select output register map for dspic33epxxxgp/mc206/506 and pic24epxxxgp/mc206 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0680 ? ?rp35r<5:0> ? ?rp20r<5:0> 0000 rpor1 0682 ? ?rp37r<5:0> ? ?rp36r<5:0> 0000 rpor2 0684 ? ?rp39r<5:0> ? ?rp38r<5:0> 0000 rpor3 0686 ? ?rp41r<5:0> ? ?rp40r<5:0> 0000 rpor4 0688 ? ?rp43r<5:0> ? ?rp42r<5:0> 0000 rpor5 068a ? ?rp55r<5:0> ? ?rp54r<5:0> 0000 rpor6 068c ? ?rp57r<5:0> ? ?rp56r<5:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0680 ? ?rp35r<5:0> ? ?rp20r<5:0> 0000 rpor1 0682 ? ?rp37r<5:0> ? ?rp36r<5:0> 0000 rpor2 0684 ? ?rp39r<5:0> ? ?rp38r<5:0> 0000 rpor3 0686 ? ?rp41r<5:0> ? ?rp40r<5:0> 0000 rpor4 0688 ? ?rp43r<5:0> ? ?rp42r<5:0> 0000 rpor5 068a ? ?rp55r<5:0> ? ?rp54r<5:0> 0000 rpor6 068c ? ?rp57r<5:0> ? ?rp56r<5:0> 0000 rpor7 068e ? ?rp97r<5:0> ? ? ? ? ? ? ? ? 0000 rpor8 0690 ? ? rp118r<5:0> ? ? ? ? ? ? ? ? 0000 rpor9 0692 ? ? ? ? ? ? ? ? ? ? rp120r<5:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 88 ? 2011-2013 microchip technology inc. table 4-29: peripheral pin select input register map for pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ? ic2r<6:0> ?ic1r<6:0> 0000 rpinr8 06b0 ? ic4r<6:0> ?ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr12 06b8 ?flt2r<6:0> ?flt1r<6:0> 0000 rpinr14 06bc ? qeb1r<6:0> ?qea1r<6:0> 0000 rpinr15 06be ? home1r<6:0> ? indx1r<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 rpinr26 06d4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 rpinr37 06ea ?synci1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr38 06ec ?dtcmp1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr39 06ee ?dtcmp3r<6:0> ?dtcmp2r<6:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-30: peripheral pin select input register map for pic24epxxxgp20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ? ic2r<6:0> ? ic1r<6:0> 0000 rpinr8 06b0 ? ic4r<6:0> ? ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 89 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-31: peripheral pin select input register map for dspic33epxxxgp50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ? ic2r<6:0> ? ic1r<6:0> 0000 rpinr8 06b0 ? ic4r<6:0> ? ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 rpinr26 06d4 ? ? ? ? ? ? ? ? ?c1rxr<6:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-32: peripheral pin select input register map for dspic33epxxxmc50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ? ic2r<6:0> ? ic1r<6:0> 0000 rpinr8 06b0 ? ic4r<6:0> ? ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr12 06b8 ?flt2r<6:0> ?flt1r<6:0> 0000 rpinr14 06bc ? qeb1r<6:0> ?qea1r<6:0> 0000 rpinr15 06be ? home1r<6:0> ? indx1r<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ?ss2r<6:0> 0000 rpinr26 06d4 ? ? ? ? ? ? ? ? ?c1rxr<6:0> 0000 rpinr37 06ea ? synci1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr38 06ec ?dtcmp1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr39 06ee ?dtcmp3r<6:0> ?dtcmp2r<6:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 90 ? 2011-2013 microchip technology inc. table 4-33: peripheral pin select input register map for dspic33epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ? ic2r<6:0> ? ic1r<6:0> 0000 rpinr8 06b0 ? ic4r<6:0> ? ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr12 06b8 ?flt2r<6:0> ?flt1r<6:0> 0000 rpinr14 06bc ? qeb1r<6:0> ? qea1r<6:0> 0000 rpinr15 06be ?home1r<6:0> ? indx1r<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ?sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 rpinr37 06ea ?synci1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr38 06ec ?dtcmp1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr39 06ee ?dtcmp3r<6:0> ?dtcmp2r<6:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 91 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-34: nvm register map table 4-35: system control register map table 4-36: reference clock register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets nvmcon 0728 wr wren wrerr nvmsidl ? ? ? ? ? ? ? ? nvmop<3:0> 0000 nvmadr 072a nvmadr<15:0> 0000 nvmadru 072c ? ? ? ? ? ? ? ? nvmadr<23:16> 0000 nvmkey 072e ? ? ? ? ? ? ? ? nvmkey<7:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rcon 0740 trapr iopuwr ? ?vregsf ? cm vregs extr swr swdten wdto sleep idle bor por note 1 osccon 0742 ?cosc<2:0> ? nosc<2:0> clklock iolock lock ?cf ? ? oswen note 2 clkdiv 0744 roi doze<2:0> dozen frcdiv<2:0> pllpost<1:0> ? pllpre<4:0> 0030 pllfbd 0746 ? ? ? ? ? ? ? plldiv<8:0> 0030 osctun 0748 ? ? ? ? ? ? ? ? ? ? tun<5:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. note 1: rcon register reset values are dependent on the type of reset. 2: osccon register reset values are dependent on the configuration fuses. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets refocon 074e roon ? rosslp rosel rodiv<3:0> ? ? ? ? ? ? ? ? 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 92 ? 2011-2013 microchip technology inc. table 4-37: pmd register map for pic24epxxxgp20x devices only table 4-38: pmd register map for pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md ? ? ? i2c1md u2md u1md spi2md spi1md ? ?ad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ?cmpmd ? ? crcmd ? ? ? ? ?i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md qei1md pwmmd ? i2c1md u2md u1md spi2md spi1md ? ?ad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ?cmpmd ? ? crcmd ? ? ? ? ?i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? pwm3md pwm2md pwm1md ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 93 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-39: pmd register map for dspic33epxxxgp50x devices only table 4-40: pmd register map for dspic33epxxxmc50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md ? ? ? i2c1md u2md u1md spi2md spi1md ?c1mdad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ?cmpmd ? ? crcmd ? ? ? ? ?i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md qei1md pwmmd ? i2c1md u2md u1md spi2md spi1md ?c1mdad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ?cmpmd ? ? crcmd ? ? ? ? ?i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? pwm3md pwm2md pwm1md ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 94 ? 2011-2013 microchip technology inc. table 4-41: pmd register map for dspic33epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md qei1md pwmmd ? i2c1md u2md u1md spi2md spi1md ? ?ad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ?cmpmd ? ? crcmd ? ? ? ? ? i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? pwm3md pwm2md pwm1md ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 95 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-42: op amp/comparator register map table 4-44: jtag interface register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets cmstat 0a80 psidl ? ? ? c4evt c3evt c2evt c1evt ? ? ? ? c4out c3out c2out c1out 0000 cvrcon 0a82 ?cvr2oe ? ? ? vrefsel ? ? cvren cvr1oe cvrr cvrss cvr<3:0> 0000 cm1con 0a84 con coe cpol ? ? opmode cevt cout evpol<1:0> ? cref ? ?cch<1:0> 0000 cm1msksrc 0a86 ? ? ? ? selsrcc<3:0> selsrcb<3:0> selsrca<3:0> 0000 cm1mskcon 0a88 hlms ? ocen ocnen oben obnen oaen oanen nags pags acen acnen aben abnen aaen aanen 0000 cm1fltr 0a8a ? ? ? ? ? ? ? ? ? cfsel<2:0> cfltren cfdiv<2:0> 0000 cm2con 0a8c con coe cpol ? ? opmode cevt cout evpol<1:0> ? cref ? ?cch<1:0> 0000 cm2msksrc 0a8e ? ? ? ? selsrcc<3:0> selsrcb<3:0> selsrca<3:0> 0000 cm2mskcon 0a90 hlms ? ocen ocnen oben obnen oaen oanen nags pags acen acnen aben abnen aaen aanen 0000 cm2fltr 0a92 ? ? ? ? ? ? ? ? ? cfsel<2:0> cfltren cfdiv<2:0> 0000 cm3con ( 1 ) 0a94 con coe cpol ? ? opmode cevt cout evpol<1:0> ? cref ? ?cch<1:0> 0000 cm3msksrc ( 1 ) 0a96 ? ? ? ? selsrcc<3:0> selsrcb<3:0> selsrca<3:0> 0000 cm3mskcon ( 1 ) 0a98 hlms ? ocen ocnen oben obnen oaen oanen nags pags acen acnen aben abnen aaen aanen 0000 cm3fltr ( 1 ) 0a9a ? ? ? ? ? ? ? ? ? cfsel<2:0> cfltren cfdiv<2:0> 0000 cm4con 0a9c con coe cpol ? ? ? cevt cout evpol<1:0> ? cref ? ?cch<1:0> 0000 cm4msksrc 0a9e ? ? ? ? selsrcc<3:0> selsrcb<3:0> selsrca<3:0> 0000 cm4mskcon 0aa0 hlms ? ocen ocnen oben obnen oaen oanen nags pags acen acnen aben abnen aaen aanen 0000 cm4fltr 0aa2 ? ? ? ? ? ? ? ? ? cfsel<2:0> cfltren cfdiv<2:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. note 1: these registers are unavailable on dspic33epxxxgp502/mc502/mc202 and pic24ep256gp/mc202 (28-pin) devices. table 4-43: ctmu register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ctmucon1 033a ctmuen ? ctmusidl tgen edgen edgseqen idissen cttrig ? ? ? ? ? ? ? ? 0000 ctmucon2 033c edg1mod edg1pol edg1sel<3:0> edg2stat edg1stat edg2mod edg2pol edg2sel<3:0> ? ? 0000 ctmuicon 033e itrim<5:0> irng<1:0> ? ? ? ? ? ? ? ? 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets jdatah 0ff0 ? ? ? ? jdatah<27:16> xxxx jdatal 0ff2 jdatal<15:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 96 ? 2011-2013 microchip technology inc. table 4-45: dmac register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets dma0con 0b00 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ? mode<1:0> 0000 dma0req 0b02 force ? ? ? ? ? ? ? irqsel<7:0> 00ff dma0stal 0b04 sta<15:0> 0000 dma0stah 0b06 ? ? ? ? ? ? ? ?sta<23:16> 0000 dma0stbl 0b08 stb<15:0> 0000 dma0stbh 0b0a ? ? ? ? ? ? ? ?stb<23:16> 0000 dma0pad 0b0c pad<15:0> 0000 dma0cnt 0b0e ? ? cnt<13:0> 0000 dma1con 0b10 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ? mode<1:0> 0000 dma1req 0b12 force ? ? ? ? ? ? ? irqsel<7:0> 00ff dma1stal 0b14 sta<15:0> 0000 dma1stah 0b16 ? ? ? ? ? ? ? ?sta<23:16> 0000 dma1stbl 0b18 stb<15:0> 0000 dma1stbh 0b1a ? ? ? ? ? ? ? ?stb<23:16> 0000 dma1pad 0b1c pad<15:0> 0000 dma1cnt 0b1e ? ? cnt<13:0> 0000 dma2con 0b20 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ? mode<1:0> 0000 dma2req 0b22 force ? ? ? ? ? ? ? irqsel<7:0> 00ff dma2stal 0b24 sta<15:0> 0000 dma2stah 0b26 ? ? ? ? ? ? ? ?sta<23:16> 0000 dma2stbl 0b28 stb<15:0> 0000 dma2stbh 0b2a ? ? ? ? ? ? ? ?stb<23:16> 0000 dma2pad 0b2c pad<15:0> 0000 dma2cnt 0b2e ? ? cnt<13:0> 0000 dma3con 0b30 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ? mode<1:0> 0000 dma3req 0b32 force ? ? ? ? ? ? ? irqsel<7:0> 00ff dma3stal 0b34 sta<15:0> 0000 dma3stah 0b36 ? ? ? ? ? ? ? ?sta<23:16> 0000 dma3stbl 0b38 stb<15:0> 0000 dma3stbh 0b3a ? ? ? ? ? ? ? ?stb<23:16> 0000 dma3pad 0b3c pad<15:0> 0000 dma3cnt 0b3e ? ? cnt<13:0> 0000 dmapwc 0bf0 ? ? ? ? ? ? ? ? ? ? ? ? pwcol3 pwcol2 pwcol1 pwcol0 0000 dmarqc 0bf2 ? ? ? ? ? ? ? ? ? ? ? ? rqcol3 rqcol2 rqcol1 rqcol0 0000 dmapps 0bf4 ? ? ? ? ? ? ? ? ? ? ? ? ppst3 ppst2 ppst1 ppst0 0000 dmalca 0bf6 ? ? ? ? ? ? ? ? ? ? ? ? lstch<3:0> 000f dsadrl 0bf8 dsadr<15:0> 0000 dsadrh 0bfa ? ? ? ? ? ? ? ? dsadr<23:16> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 97 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-46: porta register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only table 4-47: portb register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only table 4-48: portc register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 ? ? ? trisa12 trisa11 trisa10 trisa9 trisa8 trisa7 ? ? trisa4 ? ? trisa1 trisa0 1f93 porta 0e02 ? ? ? ra12 ra11 ra10 ra9 ra8 ra7 ? ?ra4 ? ?ra1ra0 0000 lata 0e04 ? ? ? lata12 lata11 lata10 lata9 lata8 lata7 ? ?lata4 ? ? la1ta1 la0ta0 0000 odca 0e06 ? ? ? odca12 odca11 odca10 odca9 odca8 odca7 ? ? odca4 ? ? odca1 odca0 0000 cnena 0e08 ? ? ? cniea12 cniea11 cniea10 cniea9 cniea8 cniea7 ? ? cniea4 ? ? cniea1 cniea0 0000 cnpua 0e0a ? ? ? cnpua12 cnpua11 cnpua10 cnpua9 cnpua8 cnpua7 ? ? cnpua4 ? ? cnpua1 cnpua0 0000 cnpda 0e0c ? ? ? cnpda12 cnpda11 cnpda10 cnpda9 cnpda8 cnpda7 ? ? cnpda4 ? ? cnpda1 cnpda0 0000 ansela 0e0e ? ? ? ansa12 ansa11 ? ? ? ? ? ?ansa4 ? ? ansa1 ansa0 1813 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 t risb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 0e12 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 0e14 latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx odcb 0e16 odcb15 odcb14 odcb13 odcb12 odcb11 odcb10 odcb9 odcb8 odcb7 odcb6 odcb5 odcb4 odcb3 odcb2 odcb1 odcb0 0000 cnenb 0e18 cnieb15 cnieb14 cnieb13 cnieb12 cnieb11 cnieb10 cni eb9 cnieb8 cnieb7 cnieb6 cnieb5 cnieb4 cnieb3 cnieb2 cnieb1 cnieb0 0000 cnpub 0e1a cnpub15 cnpub14 cnpub13 cnpub12 cnp ub11 cnpub10 cnpub9 cnpub8 cnp ub7 cnpub6 cnpub5 cnpub4 cnp ub3 cnpub2 cnpub1 cnpub0 0000 cnpdb 0e1c cnpdb15 cnpdb14 cnpdb13 cnpdb12 cnp db11 cnpdb10 cnpdb9 cnpdb8 cnp db7 cnpdb6 cnpdb5 cnpdb4 cnp db3 cnpdb2 cnpdb1 cnpdb0 0000 anselb 0e1e ? ? ? ? ? ? ?ansb8 ? ? ? ? ansb3 ansb2 ansb1 ansb0 010f legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisc 0e20 trisc15 ? trisc13 trisc12 trisc11 trisc10 trisc9 trisc8 trisc 7 trisc6 trisc5 trisc4 trisc3 trisc2 trisc1 trisc0 bfff portc 0e22 rc15 ? rc13 rc12 rc11 rc10 rc9 rc8 rc7 rc6 rc5 rc4 rc3 rc2 rc1 rc0 xxxx latc 0e24 latc15 ? latc13 latc12 latc11 latc10 latc9 latc8 latc7 latc6 latc5 latc4 latc3 latc2 latc1 latc0 xxxx odcc 0e26 odcc15 ? odcc13 odcc12 odcc11 odcc10 odcc9 odcc8 odcc7 odcc6 odcc5 odcc4 odcc3 odcc2 odcc1 odcc0 0000 cnenc 0e28 cniec15 ? cniec13 cniec12 cniec11 cniec10 cniec9 cniec8 cniec 7 cniec6 cniec5 cniec4 cni ec3 cniec2 cniec1 cniec0 0000 cnpuc 0e2a cnpuc15 ? cnpuc13 cnpuc12 cnpuc11 cnpuc10 cnpuc9 cnp uc8 cnpuc7 cnpuc6 cnpuc5 cnpuc4 cnpuc3 cnpuc2 cnpuc1 cnpuc0 0000 cnpdc 0e2c cnpdc15 ? cnpdc13 cnpdc12 cnpdc11 cnpdc10 cnpdc9 cnp dc8 cnpdc7 cnpdc6 cnpdc5 cnpdc4 cnpdc3 cnpdc2 cnpdc1 cnpdc0 0000 anselc 0e2e ? ? ? ? ansc11 ? ? ? ? ? ? ? ? ansc2 ansc1 ansc0 0807 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 98 ? 2011-2013 microchip technology inc. table 4-49: portd register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only table 4-50: porte register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only table 4-51: portf register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisd 0e30 ? ? ? ? ? ? ?trisd8 ? trisd6 trisd5 ? ? ? ? ? 0160 portd 0e32 ? ? ? ? ? ? ? rd8 ? rd6 rd5 ? ? ? ? ? xxxx latd 0e34 ? ? ? ? ? ? ?latd8 ?latd6latd5 ? ? ? ? ? xxxx odcd 0e36 ? ? ? ? ? ? ? odcd8 ? odcd6 odcd5 ? ? ? ? ? 0000 cnend 0e38 ? ? ? ? ? ? ?cnied8 ? cnied6 cnied5 ? ? ? ? ? 0000 cnpud 0e3a ? ? ? ? ? ? ? cnpud8 ? cnpud6 cnpud5 ? ? ? ? ? 0000 cnpdd 0e3c ? ? ? ? ? ? ? cnpdd8 ? cnpdd6 cnpdd5 ? ? ? ? ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trise 0e40 trise15 trise14 trise13 trise12 ? ? ? ? ? ? ? ? ? ? ? ? f000 porte 0e42 re15 re14 re13 re12 ? ? ? ? ? ? ? ? ? ? ? ? xxxx late 0e44 late15 late14 late13 late12 ? ? ? ? ? ? ? ? ? ? ? ? xxxx odce 0e46 odce15 odce14 odce13 odce12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 cnene 0e48 cniee15 cniee14 cniee13 cniee12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 cnpue 0e4a cnpue15 cnpue14 cnpue13 cnpue12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 cnpde 0e4c cnpde15 cnpde14 cnpde13 cnpde12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 ansele 0e4e anse15 anse14 anse13 anse12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisf 0e50 ? ? ? ? ? ? ? ? ? ? ? ? ? ? trisf1 trisf0 0173 portf 0e52 ? ? ? ? ? ? ? ? ? ? ? ? ? ?rf1rf0 xxxx latf 0e54 ? ? ? ? ? ? ? ? ? ? ? ? ? ? latf1 latf0 xxxx odcf 0e56 ? ? ? ? ? ? ? ? ? ? ? ? ? ? odcf1 odcf0 0000 cnenf 0e58 ? ? ? ? ? ? ? ? ? ? ? ? ? ? cnief1 cnief0 0000 cnpuf 0e5a ? ? ? ? ? ? ? ? ? ? ? ? ? ? cnpuf1 cnpuf0 0000 cnpdf 0e5c ? ? ? ? ? ? ? ? ? ? ? ? ? ? cnpdf1 cnpdf0 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 99 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-52: portg register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisg 0e60 ? ? ? ? ? ? trisg9 trisg8 t risg7 trisg6 ? ? ? ? ? ? 03c0 portg 0e62 ? ? ? ? ? ? rg9 rg8 rg7 rg6 ? ? ? ? ? ? xxxx latg 0e64 ? ? ? ? ? ? latg9 latg8 latg7 latg6 ? ? ? ? ? ? xxxx odcg 0e66 ? ? ? ? ? ? odcg9 odcg8 odcg7 odcg6 ? ? ? ? ? ? 0000 cneng 0e68 ? ? ? ? ? ? cnieg9 cnieg8 cnieg7 cnieg6 ? ? ? ? ? ? 0000 cnpug 0e6a ? ? ? ? ? ? cnpug9 cnpug8 cnpug7 cnpug6 ? ? ? ? ? ? 0000 cnpdg 0e6c ? ? ? ? ? ? cnpdg9 cnpdg8 cnpdg7 cnpdg6 ? ? ? ? ? ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 100 ? 2011-2013 microchip technology inc. table 4-53: porta register map for pic24epxxxgp/mc204 and dspic33epxxxgp/mc204/504 devices only table 4-54: portb register map for pic24epxxxgp/mc204 and dspic33epxxxgp/mc204/504 devices only table 4-55: portc register map for pic24epxxxgp/mc204 and dspic33epxxxgp/mc204/504 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 ? ? ? ? ? trisa10 trisa9 trisa8 trisa7 ? ? trisa4 trisa3 trisa2 trisa1 trisa0 079f porta 0e02 ? ? ? ? ? ra10 ra9 ra8 ra7 ? ? ra4 ra3 ra2 ra1 ra0 0000 lata 0e04 ? ? ? ? ? lata10 lata9 lata8 lata7 ? ? lata4 lata3 lata2 la1ta1 la0ta0 0000 odca 0e06 ? ? ? ? ? odca10 odca9 odca8 odca7 ? ? odca4 odca3 odca2 odca1 odca0 0000 cnena 0e08 ? ? ? ? ? cniea10 cniea9 cniea8 cniea7 ? ? cniea4 cniea3 cniea2 cniea1 cniea0 0000 cnpua 0e0a ? ? ? ? ? cnpua10 cnpua9 cnpua8 cnpua7 ? ? cnpua4 cnpua3 cnpua2 cnpua1 cnpua0 0000 cnpda 0e0c ? ? ? ? ? cnpda10 cnpda9 cnpda8 cnpda7 ? ? cnpda4 cnpda3 cnpda2 cnpda1 cnpda0 0000 ansela 0e0e ? ? ? ? ? ? ? ? ? ? ?ansa4 ? ? ansa1 ansa0 0013 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 trisb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 0e12 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 0e14 latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx odcb 0e16 odcb15 odcb14 odcb13 odcb12 odcb11 odcb10 odcb9 odcb8 odcb7 odcb6 odcb5 odcb4 odcb3 odcb2 odcb1 odcb0 0000 cnenb 0e18 cnieb15 cnieb14 cnieb13 cnieb12 cnieb11 cnieb10 cni eb9 cnieb8 cnieb7 cnieb6 cnieb5 cnieb4 cnieb3 cnieb2 cnieb1 cnieb0 0000 cnpub 0e1a cnpub15 cnpub14 cnpub13 cnpub12 cnp ub11 cnpub10 cnpub9 cnpub8 cnp ub7 cnpub6 cnpub5 cnpub4 cnp ub3 cnpub2 cnpub1 cnpub0 0000 cnpdb 0e1c cnpdb15 cnpdb14 cnpdb13 cnpdb12 cnp db11 cnpdb10 cnpdb9 cnpdb8 cnp db7 cnpdb6 cnpdb5 cnpdb4 cnp db3 cnpdb2 cnpdb1 cnpdb0 0000 anselb 0e1e ? ? ? ? ? ? ?ansb8 ? ? ? ? ansb3 ansb2 ansb1 ansb0 010f legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisc 0e20 ? ? ? ? ? ? trisc9 trisc8 trisc7 trisc6 trisc5 t risc4 trisc3 trisc2 trisc1 trisc0 03ff portc 0e22 ? ? ? ? ? ? rc9 rc8 rc7 rc6 rc5 rc4 rc3 rc2 rc1 rc0 xxxx latc 0e24 ? ? ? ? ? ? latc9 latc8 latc7 latc6 latc5 latc4 latc3 latc2 latc1 latc0 xxxx odcc 0e26 ? ? ? ? ? ? odcc9 odcc8 odcc7 odcc6 odcc5 odcc4 odcc3 odcc2 odcc1 odcc0 0000 cnenc 0e28 ? ? ? ? ? ? cniec9 cniec8 cniec7 cniec6 cniec5 cniec4 cniec3 cniec2 cniec1 cniec0 0000 cnpuc 0e2a ? ? ? ? ? ? cnpuc9 cnpuc8 cnpuc7 cnpuc6 cnpuc5 cnpuc4 cnpuc3 cnpuc2 cnpuc1 cnpuc0 0000 cnpdc 0e2c ? ? ? ? ? ? cnpdc9 cnpdc8 cnpdc7 cnpdc6 cnpdc5 cnpdc4 cnpdc3 cnpdc2 cnpdc1 cnpdc0 0000 anselc 0e2e ? ? ? ? ? ? ? ? ? ? ? ? ? ansc2 ansc1 ansc0 0007 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 101 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 4-56: porta register map for pic24epxxxgp/mc203 and dspic33epxxxgp/mc203/503 devices only table 4-57: portb register map for pic24epxxxgp/mc203 and dspic33epxxxgp/mc203/503 devices only table 4-58: portc register map for pic24epxxxgp/mc203 and dspic33epxxxgp/mc203/503 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 ? ? ? ? ? ? ? trisa8 ? ? ? trisa4 trisa3 trisa2 trisa1 trisa0 011f porta 0e02 ? ? ? ? ? ? ?ra8 ? ? ? ra4 ra3 ra2 ra1 ra0 0000 lata 0e04 ? ? ? ? ? ? ?lata8 ? ? ? lata4 lata3 lata2 la1ta1 la0ta0 0000 odca 0e06 ? ? ? ? ? ? ? odca8 ? ? ? odca4 odca3 odca2 odca1 odca0 0000 cnena 0e08 ? ? ? ? ? ? ? cniea8 ? ? ? cniea4 cniea3 cniea2 cniea1 cniea0 0000 cnpua 0e0a ? ? ? ? ? ? ? cnpua8 ? ? ? cnpua4 cnpua3 cnpua2 cnpua1 cnpua0 0000 cnpda 0e0c ? ? ? ? ? ? ? cnpda8 ? ? ? cnpda4 cnpda3 cnpda2 cnpda1 cnpda0 0000 ansela 0e0e ? ? ? ? ? ? ? ? ? ? ?ansa4 ? ? ansa1 ansa0 0013 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 trisb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 0e12 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 0e14 latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx odcb 0e16 odcb15 odcb14 odcb13 odcb12 odcb11 odcb10 odcb9 odcb8 odcb7 odcb6 odcb5 odcb4 odcb3 odcb2 odcb1 odcb0 0000 cnenb 0e18 cnieb15 cnieb14 cnieb13 cnieb12 cnieb11 cnieb10 cni eb9 cnieb8 cnieb7 cnieb6 cnieb5 cnieb4 cnieb3 cnieb2 cnieb1 cnieb0 0000 cnpub 0e1a cnpub15 cnpub14 cnpub13 cnpub12 cnp ub11 cnpub10 cnpub9 cnpub8 cnp ub7 cnpub6 cnpub5 cnpub4 cnp ub3 cnpub2 cnpub1 cnpub0 0000 cnpdb 0e1c cnpdb15 cnpdb14 cnpdb13 cnpdb12 cnp db11 cnpdb10 cnpdb9 cnpdb8 cnp db7 cnpdb6 cnpdb5 cnpdb4 cnp db3 cnpdb2 cnpdb1 cnpdb0 0000 anselb 0e1e ? ? ? ? ? ? ?ansb8 ? ? ? ? ansb3 ansb2 ansb1 ansb0 010f legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisc 0e20 ? ? ? ? ? ? ?trisc8 ? ? ? ? ? ? trisc1 trisc0 0107 portc 0e22 ? ? ? ? ? ? ? rc8 ? ? ? ? ? ? rc1 rc0 xxxx latc 0e24 ? ? ? ? ? ? ?latc8 ? ? ? ? ? ?latc1latc0 xxxx odcc 0e26 ? ? ? ? ? ? ? odcc8 ? ? ? ? ? ? odcc1 odcc0 0000 cnenc 0e28 ? ? ? ? ? ? ? cniec8 ? ? ? ? ? ? cniec1 cniec0 0000 cnpuc 0e2a ? ? ? ? ? ? ? cnpuc8 ? ? ? ? ? ? cnpuc1 cnpuc0 0000 cnpdc 0e2c ? ? ? ? ? ? ? cnpdc8 ? ? ? ? ? ? cnpdc1 cnpdc0 0000 anselc 0e2e ? ? ? ? ? ? ? ? ? ? ? ? ? ? ansc1 ansc0 0007 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 102 ? 2011-2013 microchip technology inc. table 4-59: porta register map for pic24epxxxgp/mc202 and dspic33epxxxgp/mc202/502 devices only table 4-60: portb register map for pic24epxxxgp/mc202 and dspic33epxxxgp/mc202/502 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 ? ? ? ? ? ? ? ? ? ? ? trisa4 trisa3 trisa2 trisa1 trisa0 001c porta 0e02 ? ? ? ? ? ? ? ? ? ? ? ra4 ra3 ra2 ra1 ra0 0000 lata 0e04 ? ? ? ? ? ? ? ? ? ? ? lata4 lata3 lata2 la1ta1 la0ta0 0000 odca 0e06 ? ? ? ? ? ? ? ? ? ? ? odca4 odca3 odca2 odca1 odca0 0000 cnena 0e08 ? ? ? ? ? ? ? ? ? ? ? cniea4 cniea3 cniea2 cniea1 cniea0 0000 cnpua 0e0a ? ? ? ? ? ? ? ? ? ? ? cnpua4 cnpua3 cnpua2 cnpua1 cnpua0 0000 cnpda 0e0c ? ? ? ? ? ? ? ? ? ? ? cnpda4 cnpda3 cnpda2 cnpda1 cnpda0 0000 ansela 0e0e ? ? ? ? ? ? ? ? ? ? ?ansa4 ? ? ansa1 ansa0 0013 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 trisb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 0e12 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 0e14 latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx odcb 0e16 odcb15 odcb14 odcb13 odcb12 odcb11 odcb10 odcb9 odcb8 odcb7 odcb6 odcb5 odcb4 odcb3 odcb2 odcb1 odcb0 0000 cnenb 0e18 cnieb15 cnieb14 cnieb13 cnieb12 cnieb11 cnieb10 cni eb9 cnieb8 cnieb7 cnieb6 cnieb5 cnieb4 cnieb3 cnieb2 cnieb1 cnieb0 0000 cnpub 0e1a cnpub15 cnpub14 cnpub13 cnpub12 cnp ub11 cnpub10 cnpub9 cnpub8 cnp ub7 cnpub6 cnpub5 cnpub4 cnp ub3 cnpub2 cnpub1 cnpub0 0000 cnpdb 0e1c cnpdb15 cnpdb14 cnpdb13 cnpdb12 cnp db11 cnpdb10 cnpdb9 cnpdb8 cnp db7 cnpdb6 cnpdb5 cnpdb4 cnp db3 cnpdb2 cnpdb1 cnpdb0 0000 anselb 0e1e ? ? ? ? ? ? ?ansb8 ? ? ? ? ansb3 ansb2 ansb1 ansb0 010f legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011-2013 microchip technology inc. ds70657g-page 103 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.4.1 paged memory scheme the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x architecture extends the available data space through a paging scheme, which allows the available data space to be accessed using mov instructions in a linear fashion for pre- and post-modified effective addresses (ea). the upper half of the base data space address is used in conjunction with the data space page registers, the 10-bit read page register (dsrpag) or the 9-bit write page register (dswpag), to form an extended data space (eds) address or program space visibility (psv) address. the data space page registers are located in the sfr space. construction of the eds address is shown in figure 4-1 . when dsrpag<9> = 0 and the base address bit, ea<15> = 1 , the dsrpag<8:0> bits are concatenated onto ea<14:0> to form the 24-bit eds read address. similarly, when base address bit, ea<15> = 1 , dswpag<8:0> are concatenated onto ea<14:0> to form the 24-bit eds write address. example 4-1: extended data space (eds) read address generation 1 dsrpag<8:0> 9 bits ea 15 bits select byte 24-bit eds ea select ea (dsrpag = don?t care) no eds access select 16-bit ds ea byte ea<15> = 0 dsrpag 0 ea<15> note: ds read access when dsrpag = 0x000 will force an address error trap. = 1 ? dsrpag<9> y n generate psv address 0
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 104 ? 2011-2013 microchip technology inc. example 4-2: extended data space (eds) write address generation the paged memory scheme provides access to multiple 32-kbyte windows in the eds and psv memory. the data space page registers, dsxpag, in combination with the upper half of data space address, can provide up to 16 mbytes of additional address space in the eds and 8 mbytes (dsrpag only) of psv address space. the paged data memory space is shown in example 4-3 . the program space (ps) can be accessed with a dsrpag of 0x200 or greater. only reads from ps are supported using the dsrpag. writes to ps are not supported, so dswpag is dedicated to ds, including eds only. the data space and eds can be read from, and written to, using dsrpag and dswpag, respectively. 1 dswpag<8:0> 9 bits ea 15 bits byte 24-bit eds ea select ea (dswpag = don?t care) no eds access select 16-bit ds ea byte ea<15> = 0 ea<15> note: ds read access when dsrpag = 0x000 will force an address error trap. generate psv address 0
? 2011-2013 microchip technology inc. ds70657g-page 105 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x example 4-3: paged data memory space 0x0000 program memory 0x0000 0x7fff 0x7fff eds page 0x001 0x0000 sfr registers 0x0fff 0x1000 up to 8-kbyte 0x2fff local data space eds (dsrpag<9:0>/dswpag<8:0>) reserved (will produce an address error trap) 32-kbyte eds window 0xffff 0x3000 page 0 program space 0x00_0000 0x7f_ffff (lsw ? <15:0>) 0x0000 (dsrpag = 0x001) (dswpag = 0x001) eds page 0x1ff (dsrpag = 0x1ff) (dswpag = 0x1ff) eds page 0x200 (dsrpag = 0x200) psv program memory eds page 0x2ff (dsrpag = 0x2ff) eds page 0x300 (dsrpag = 0x300) eds page 0x3ff (dsrpag = 0x3ff) 0x7fff 0x0000 0x7fff 0x0000 0x7fff 0x0000 0x7fff 0x0000 0x7fff ds_addr<14:0> ds_addr<15:0> (lsw) psv program memory (msb) table address space (tblpag<7:0>) program memory 0x00_0000 0x7f_ffff (msb ? <23:16>) 0x0000 (tblpag = 0x00) 0xffff ds_addr<15:0> lsw using tblrdl/tblwtl msb using tblrdh/tblwth 0x0000 (tblpag = 0x7f) 0xffff lsw using tblrdl/tblwtl msb using tblrdh/tblwth (instruction & data) no writes allowed no writes allowed no writes allowed no writes allowed ram 0x7fff 0x8000
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 106 ? 2011-2013 microchip technology inc. allocating different page registers for read and write access allows the architecture to support data movement between different pages in data memory. this is accomplished by setting the dsrpag register value to the page from which you want to read, and configuring the dswpag register to the page to which it needs to be written. data can also be moved from different psv to eds pages, by configuring the dsrpag and dswpag registers to address psv and eds space, respectively. the data can be moved between pages by a single instruction. when an eds or psv page overflow or underflow occurs, ea<15> is cleared as a result of the register indirect ea calculation. an overflow or underflow of the ea in the eds or psv pages can occur at the page boundaries when: ? the initial address prior to modification addresses an eds or psv page ? the ea calculation uses pre- or post-modified register indirect addressing; however, this does not include register offset addressing in general, when an overflow is detected, the dsxpag register is incremented and the ea<15> bit is set to keep the base address within the eds or psv window. when an underflow is detected, the dsxpag register is decremented and the ea<15> bit is set to keep the base address within the eds or psv window. this creates a linear eds and psv address space, but only when using register indirect addressing modes. exceptions to the operation described above arise when entering and exiting the boundaries of page 0, eds and psv spaces. ta b l e 4 - 6 1 lists the effects of overflow and underflow scenarios at different boundaries. in the following cases, when overflow or underflow occurs, the ea<15> bit is set and the dsxpag is not modified; therefore, the ea will wrap to the beginning of the current page: ? register indirect with register offset addressing ? modulo addressing ? bit-reversed addressing table 4-61: overflow and underflow scenarios at page 0, eds and psv space boundaries ( 2 , 3 , 4 ) o/u, r/w operation before after dsxpag ds ea<15> page description dsxpag ds ea<15> page description o, read [++wn] or [wn++] dsrpag = 0x1ff 1 eds: last page dsrpag = 0x1ff 0 see note 1 o, read dsrpag = 0x2ff 1 psv: last lsw page dsrpag = 0x300 1 psv: first msb page o, read dsrpag = 0x3ff 1 psv: last msb page dsrpag = 0x3ff 0 see note 1 o, write dswpag = 0x1ff 1 eds: last page dswpag = 0x1ff 0 see note 1 u, read [--wn] or [wn--] dsrpag = 0x001 1 psv page dsrpag = 0x001 0 see note 1 u, read dsrpag = 0x200 1 psv: first lsw page dsrpag = 0x200 0 see note 1 u, read dsrpag = 0x300 1 psv: first msb page dsrpag = 0x2ff 1 psv: last lsw page legend: o = overflow, u = underflow, r = read, w = write note 1: the register indirect addressing now addresses a location in the base data space (0x0000-0x8000). 2: an eds access with dsxpag = 0x000 will generate an address error trap. 3: only reads from ps are supported using dsrpag. an attempt to write to ps using dswpag will generate an address error trap. 4: pseudo-linear addressing is not supported for large offsets.
? 2011-2013 microchip technology inc. ds70657g-page 107 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.4.2 extended x data space the lower portion of the base address space range, between 0x0000 and 0x2fff, is always accessible regardless of the contents of the data space page registers. it is indirectly addressable through the register indirect instructions. it can be regarded as being located in the default eds page 0 (i.e., eds address range of 0x000000 to 0x002fff with the base address bit, ea<15> = 0 , for this address range). however, page 0 cannot be accessed through the upper 32 kbytes, 0x8000 to 0xffff, of base data space, in combination with dsrpag = 0x00 or dswpag = 0x00. consequently, dsrpag and dswpag are initialized to 0x001 at reset. the remaining pages, including both eds and psv pages, are only accessible using the dsrpag or dswpag registers in combination with the upper 32 kbytes, 0x8000 to 0xffff, of the base address, where base address bit, ea<15> = 1 . for example, when dsrpag = 0x01 or dswpag = 0x01, accesses to the upper 32 kbytes, 0x8000 to 0xffff, of the data space will map to the eds address range of 0x008000 to 0x00ffff. when dsrpag = 0x02 or dswpag = 0x02, accesses to the upper 32 kbytes of the data space will map to the eds address range of 0x010000 to 0x017fff and so on, as shown in the eds memory map in figure 4-17 . for more information on the psv page access using data space page registers, refer to section 4.5 ?program space visibility from data space? in section 4. ?program memory? (ds70613) of the ?dspic33e/pic24e family reference manual? . figure 4-17: eds memory map note 1: dsxpag should not be used to access page 0. an eds access with dsxpag set to 0x000 will generate an address error trap. 2: clearing the dsxpag in software has no effect. 0x008000 0x010000 0x018000 page 3 page 2 page 1fd 0xfe8000 0xff0000 0xff8000 page 1ff page 1fe sfr/ds 0x0000 0xffff eds ea address (24 bits) ds conventional ea<15:0> 0x8000 (page 0) (dsrpag<8:0>, ea<14:0>) (dswpag<8:0>, ea<14:0>) page 1 dsrpag<9> = 0 ds address
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 108 ? 2011-2013 microchip technology inc. 4.4.3 data memory arbitration and bus master priority eds accesses from bus masters in the system are arbitrated. the arbiter for data memory (including eds) arbitrates between the cpu, the dma and the icd module. in the event of coincidental access to a bus by the bus masters, the arbiter determines which bus master access has the highest priority. the other bus masters are suspended and processed after the access of the bus by the bus master with the highest priority. by default, the cpu is bus master 0 (m0) with the highest priority and the icd is bus master 4 (m4) with the lowest priority. the remaining bus master (dma controller) is allocated to m3 (m1 and m2 are reserved and cannot be used). the user application may raise or lower the priority of the dma controller to be above that of the cpu by setting the appropriate bits in the eds bus master priority control (mstrpr) register. all bus masters with raised priorities will maintain the same priority relationship relative to each other (i.e., m1 being highest and m3 being lowest, with m2 in between). also, all the bus masters with priorities below that of the cpu maintain the same priority relationship relative to each other. the priority schemes for bus masters with different mstrpr values are tabulated in table 4-62 . this bus master priority control allows the user application to manipulate the real-time response of the system, either statically during initialization or dynamically in response to real-time events. table 4-62: data memory bus arbiter priority figure 4-18: arbiter architecture priority mstrpr<15:0> bit setting ( 1 ) 0x0000 0x0020 m0 (highest) cpu dma m1 reserved cpu m2 reserved reserved m3 dma reserved m4 (lowest) icd icd note 1: all other values of mstrpr<15:0> are reserved. icd reserved data memory arbiter m0 m1 m2 m3 m4 mstrpr<15:0> dma cpu sram
? 2011-2013 microchip technology inc. ds70657g-page 109 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.4.4 software stack the w15 register serves as a dedicated software stack pointer (sp) and is automatically modified by exception processing, subroutine calls and returns; however, w15 can be referenced by any instruction in the same manner as all other w registers. this simplifies reading, writing and manipulating of the stack pointer (for example, creating stack frames). w15 is initialized to 0x1000 during all resets. this address ensures that the sp points to valid ram in all dspic33epxxxgp50x, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices, and permits stack availability for non-maskable trap exceptions. these can occur before the sp is initialized by the user software. you can reprogram the sp during initialization to any location within data space. the stack pointer always points to the first available free word and fills the software stack working from lower toward higher addresses. figure 4-19 illustrates how it pre-decrements for a stack pop (read) and post-increments for a stack push (writes). when the pc is pushed onto the stack, pc<15:0> are pushed onto the first available stack word, then pc<22:16> are pushed into the second available stack location. for a pc push during any call instruction, the msb of the pc is zero-extended before the push, as shown in figure 4-19 . during exception processing, the msb of the pc is concatenated with the lower 8 bits of the cpu status register, sr. this allows the contents of srl to be preserved automatically during interrupt processing. figure 4-19: call stack frame note: to protect against misaligned stack accesses, w15<0> is fixed to ? 0 ? by the hardware. note 1: to maintain system stack pointer (w15) coherency, w15 is never subject to (eds) paging, and is therefore restricted to an address range of 0x0000 to 0xffff. the same applies to the w14 when used as a stack frame pointer (sfa = 1 ). 2: as the stack can be placed in, and can access x and y spaces, care must be taken regarding its use, particularly with regard to local automatic variables in a c development environment pc<15:1> b?000000000? 0 15 w15 (before call ) w15 (after call ) stack grows toward higher address 0x0000 pc<22:16> call subr
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 110 ? 2011-2013 microchip technology inc. 4.5 instruction addressing modes the addressing modes shown in ta b l e 4 - 6 3 form the basis of the addressing modes optimized to support the specific features of individual instructions. the addressing modes provided in the mac class of instructions differ from those in the other instruction types. 4.5.1 file register instructions most file register instructions use a 13-bit address field (f) to directly address data present in the first 8192 bytes of data memory (near data space). most file register instructions employ a working register, w0, which is denoted as wreg in these instructions. the destination is typically either the same file register or wreg (with the exception of the mul instruction), which writes the result to a register or register pair. the mov instruction allows additional flexibility and can access the entire data space. 4.5.2 mcu instructions the three-operand mcu instructions are of the form: operand 3 = operand 1 operand 2 where operand 1 is always a working register (that is, the addressing mode can only be register direct), which is referred to as wb. operand 2 can be a w reg- ister fetched from data memory or a 5-bit literal. the result location can either be a w register or a data memory location. the following addressing modes are supported by mcu instructions: ? register direct ? register indirect ? register indirect post-modified ? register indirect pre-modified ? 5-bit or 10-bit literal table 4-63: fundamental addressing modes supported note: not all instructions support all the addressing modes given above. individ- ual instructions can support different subsets of these addressing modes. addressing mode description file register direct the address of the file register is specified explicitly. register direct the contents of a register are accessed directly. register indirect the contents of wn form the effective address (ea). register indirect post-modified the contents of wn form the ea. wn is post-modified (incremented or decremented) by a constant value. register indirect pre-modified wn is pre-modified (incremented or decremented) by a signed constant value to form the ea. register indirect with register offset (register indexed) the sum of wn and wb forms the ea. register indirect with literal offset the sum of wn and a literal forms the ea.
? 2011-2013 microchip technology inc. ds70657g-page 111 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.5.3 move and accumulator instructions move instructions, which apply to dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices, and the dsp accumulator class of instructions, which apply to the dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices, provide a greater degree of addressing flexibility than other instructions. in addition to the addressing modes supported by most mcu instructions, move and accumulator instructions also support register indirect with register offset addressing mode, also referred to as register indexed mode. in summary, the following addressing modes are supported by move and accumulator instructions: ? register direct ? register indirect ? register indirect post-modified ? register indirect pre-modified ? register indirect with register offset (indexed) ? register indirect with literal offset ? 8-bit literal ? 16-bit literal 4.5.4 mac instructions (dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only) the dual source operand dsp instructions ( clr , ed , edac , mac , mpy , mpy.n , movsac and msc ), also referred to as mac instructions, use a simplified set of addressing modes to allow the user application to effectively manipulate the data pointers through register indirect tables. the two-source operand prefetch registers must be members of the set {w8, w9, w10, w11}. for data reads, w8 and w9 are always directed to the x ragu, and w10 and w11 are always directed to the y agu. the effective addresses generated (before and after modification) must therefore, be valid addresses within x data space for w8 and w9, and y data space for w10 and w11. in summary, the following addressing modes are supported by the mac class of instructions: ? register indirect ? register indirect post-modified by 2 ? register indirect post-modified by 4 ? register indirect post-modified by 6 ? register indirect with register offset (indexed) 4.5.5 other instructions besides the addressing modes outlined previously, some instructions use literal constants of various sizes. for example, bra (branch) instructions use 16-bit signed literals to specify the branch destination directly, whereas the disi instruction uses a 14-bit unsigned literal field. in some instructions, such as ulnk , the source of an operand or result is implied by the opcode itself. certain operations, such as a nop , do not have any operands. note: for the mov instructions, the addressing mode specified in the instruction can differ for the source and destination ea. how- ever, the 4-bit wb (register offset) field is shared by both source and destination (but typically only used by one). note: not all instructions support all the addressing modes given above. individual instructions may support different subsets of these addressing modes. note: register indirect with register offset addressing mode is available only for w9 (in x space) and w11 (in y space).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 112 ? 2011-2013 microchip technology inc. 4.6 modulo addressing (dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only) modulo addressing mode is a method of providing an automated means to support circular data buffers using hardware. the objective is to remove the need for software to perform data address boundary checks when executing tightly looped code, as is typical in many dsp algorithms. modulo addressing can operate in either data or pro- gram space (since the data pointer mechanism is essentially the same for both). one circular buffer can be supported in each of the x (which also provides the point- ers into program space) and y data spaces. modulo addressing can operate on any w register pointer. how- ever, it is not advisable to use w14 or w15 for modulo addressing since these two registers are used as the stack frame pointer and stack pointer, respectively. in general, any particular circular buffer can be config- ured to operate in only one direction, as there are certain restrictions on the buffer start address (for incrementing buffers) or end address (for decrementing buffers), based upon the direction of the buffer. the only exception to the usage restrictions is for buffers that have a power-of-two length. as these buffers satisfy the start and end address criteria, they can operate in a bidirectional mode (that is, address boundary checks are performed on both the lower and upper address boundaries). 4.6.1 start and end address the modulo addressing scheme requires that a starting and ending address be specified, and loaded into the 16-bit modulo buffer address registers: xmodsrt, xmodend, ymodsrt and ymodend (see table 4-1 ). the length of a circular buffer is not directly specified. it is determined by the difference between the corre- sponding start and end addresses. the maximum possible length of the circular buffer is 32k words (64 kbytes). 4.6.2 w address register selection the modulo and bit-reversed addressing control register, modcon<15:0>, contains enable flags as well as a w register field to specify the w address registers. the xwm and ywm fields select the registers that operate with modulo addressing: ? if xwm = 1111 , x ragu and x wagu modulo addressing is disabled ? if ywm = 1111 , y agu modulo addressing is disabled the x address space pointer w register (xwm), to which modulo addressing is to be applied, is stored in modcon<3:0> (see table 4-1 ). modulo addressing is enabled for x data space when xwm is set to any value other than ? 1111 ? and the xmoden bit is set (modcon<15>). the y address space pointer w register (ywm) to which modulo addressing is to be applied is stored in modcon<7:4>. modulo addressing is enabled for y data space when ywm is set to any value other than ? 1111 ? and the ymoden bit is set at modcon<14>. figure 4-20: modulo address ing operation example note: y space modulo addressing ea calcula- tions assume word-sized data (lsb of every ea is always clear). 0x1100 0x1163 start addr = 0x1100 end addr = 0x1163 length = 0x0032 words byte address mov #0x1100, w0 mov w0, xmodsrt ;set modulo start address mov #0x1163, w0 mov w0, modend ;set modulo end address mov #0x8001, w0 mov w0, modcon ;enable w1, x agu for modulo mov #0x0000, w0 ;w0 holds buffer fill value mov #0x1110, w1 ;point w1 to buffer do again, #0x31 ;fill the 50 buffer locations mov w0, [w1++] ;fill the next location again: inc w0, w0 ;increment the fill value
? 2011-2013 microchip technology inc. ds70657g-page 113 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.6.3 modulo addressing applicability modulo addressing can be applied to the effective address (ea) calculation associated with any w register. address boundaries check for addresses equal to: ? the upper boundary addresses for incrementing buffers ? the lower boundary addresses for decrementing buffers it is important to realize that the address boundaries check for addresses less than or greater than the upper (for incrementing buffers) and lower (for decrementing buffers) boundary addresses (not just equal to). address changes can, therefore, jump beyond boundaries and still be adjusted correctly. 4.7 bit-reversed addressing (dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only) bit-reversed addressing mode is intended to simplify data reordering for radix-2 fft algorithms. it is supported by the x agu for data writes only. the modifier, which can be a constant value or register contents, is regarded as having its bit order reversed. the address source and destination are kept in normal order. thus, the only operand requiring reversal is the modifier. 4.7.1 bit-reversed addressing implementation bit-reversed addressing mode is enabled in any of these situations: ? bwmx bits (w register selection) in the modcon register are any value other than ? 1111 ? (the stack cannot be accessed using bit-reversed addressing) ? the bren bit is set in the xbrev register ? the addressing mode used is register indirect with pre-increment or post-increment if the length of a bit-reversed buffer is m = 2 n bytes, the last ?n? bits of the data buffer start address must be zeros. xb<14:0> is the bit-reversed addressing modifier, or ?pivot point?, which is typically a constant. in the case of an fft computation, its value is equal to half of the fft data buffer size. when enabled, bit-reversed addressing is executed only for register indirect with pre-increment or post- increment addressing and word-sized data writes. it does not function for any other addressing mode or for byte-sized data and normal addresses are generated instead. when bit-reversed addressing is active, the w address pointer is always added to the address modifier (xb) and the offset associated with the register indirect addressing mode is ignored. in addition, as word-sized data is a requirement, the lsb of the ea is ignored (and always clear). if bit-reversed addressing has already been enabled by setting the bren (xbrev<15>) bit, a write to the xbrev register should not be immediately followed by an indirect read operation using the w register that has been designated as the bit-reversed pointer. note: the modulo corrected effective address is written back to the register only when pre-modify or post-modify addressing mode is used to compute the effective address. when an address offset (such as [w7 + w2]) is used, modulo addressing correction is performed but the contents of the register remain unchanged. note: all bit-reversed ea calculations assume word-sized data (lsb of every ea is always clear). the xb value is scaled accordingly to generate compatible (byte) addresses. note: modulo addressing and bit-reversed addressing can be enabled simultaneously using the same w register, but bit- reversed addressing operation will always take precedence for data writes when enabled.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 114 ? 2011-2013 microchip technology inc. figure 4-21: bit-reversed addressing example table 4-64: bit-reversed addres sing sequence (16-entry) normal address bit-reversed address a3 a2 a1 a0 decimal a3 a2 a1 a0 decimal 0000 0 0000 0 0001 1 1000 8 0010 2 0100 4 0011 3 1100 12 0100 4 0010 2 0101 5 1010 10 0110 6 0110 6 0111 7 1110 14 1000 8 0001 1 1001 9 1001 9 1010 10 0101 5 1011 11 1101 13 1100 12 0011 3 1101 13 1011 11 1110 14 0111 7 1111 15 1111 15 b3 b2 b1 0 b2 b3 b4 0 bit locations swapped left-to-right around center of binary value bit-reversed address xb = 0x0008 for a 16-word bit-reversed buffer b7 b6 b5 b1 b7 b6 b5 b4 b11 b10 b9 b8 b11 b10 b9 b8 b15 b14 b13 b12 b15 b14 b13 b12 sequential address pivot point
? 2011-2013 microchip technology inc. ds70657g-page 115 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 4.8 interfacing program and data memory spaces the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x architecture uses a 24-bit-wide program space (ps) and a 16-bit-wide data space (ds). the architecture is also a modified harvard scheme, meaning that data can also be present in the program space. to use this data suc- cessfully, it must be accessed in a way that preserves the alignment of information in both spaces. aside from normal execution, the architecture of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices provides two methods by which program space can be accessed during operation: ? using table instructions to access individual bytes or words anywhere in the program space ? remapping a portion of the program space into the data space (program space visibility) table instructions allow an application to read or write to small areas of the program memory. this capability makes the method ideal for accessing data tables that need to be updated periodically. it also allows access to all bytes of the program word. the remapping method allows an application to access a large block of data on a read-only basis, which is ideal for look-ups from a large table of static data. the application can only access the least significant word of the program word. table 4-65: program space address construction figure 4-22: data access from program space address generation access type access space program space address <23> <22:16> <15> <14:1> <0> instruction access (code execution) user 0 pc<22:1> 0 0xx xxxx xxxx xxxx xxxx xxx0 tblrd/tblwt (byte/word read/write) user tblpag<7:0> data ea<15:0> 0xxx xxxx xxxx xxxx xxxx xxxx configuration tblpag<7:0> data ea<15:0> 1xxx xxxx xxxx xxxx xxxx xxxx 0 program counter 23 bits program counter (1) tblpag 8 bits ea 16 bits byte select 0 1/0 user/configuration table operations (2) space select 24 bits 1/0 note 1: the least significant bit (lsb) of program space addresses is always fixed as ? 0 ? to maintain word alignment of data in the program and data spaces. 2: table operations are not required to be word-aligned. table read operations are permitted in the configuration memory space.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 116 ? 2011-2013 microchip technology inc. 4.8.1 data access from program memory using table instructions the tblrdl and tblwtl instructions offer a direct method of reading or writing the lower word of any address within the program space without going through data space. the tblrdh and tblwth instructions are the only method to read or write the upper 8 bits of a program space word as data. the pc is incremented by two for each successive 24-bit program word. this allows program memory addresses to directly map to data space addresses. program memory can thus be regarded as two 16-bit- wide word address spaces, residing side by side, each with the same address range. tblrdl and tblwtl access the space that contains the least significant data word. tblrdh and tblwth access the space that contains the upper data byte. two table instructions are provided to move byte or word-sized (16-bit) data to and from program space. both function as either byte or word operations. ? tblrdl (table read low): - in word mode, this instruction maps the lower word of the program space location (p<15:0>) to a data address (d<15:0>) - in byte mode, either the upper or lower byte of the lower program word is mapped to the lower byte of a data address. the upper byte is selected when byte select is ? 1 ?; the lower byte is selected when it is ? 0 ?. ? tblrdh (table read high): - in word mode, this instruction maps the entire upper word of a program address (p<23:16>) to a data address. the ?phantom? byte (d<15:8>) is always ? 0 ?. - in byte mode, this instruction maps the upper or lower byte of the program word to d<7:0> of the data address in the tblrdl instruc- tion. the data is always ? 0 ? when the upper ?phantom? byte is selected (byte select = 1 ). in a similar fashion, two table instructions, tblwth and tblwtl , are used to write individual bytes or words to a program space address. the details of their operation are explained in section 5.0 ?flash program memory? . for all table operations, the area of program memory space to be accessed is determined by the table page register (tblpag). tblpag covers the entire program memory space of the device, including user application and configuration spaces. when tblpag<7> = 0 , the table page is located in the user memory space. when tblpag<7> = 1 , the page is located in configuration space. figure 4-23: accessing program memory with table instructions 0 8 16 23 00000000 00000000 00000000 00000000 ?phantom? byte tblrdh.b (wn<0> = 0 ) tblrdl.w tblrdl.b (wn<0> = 1 ) tblrdl.b (wn<0> = 0 ) 23 15 0 tblpag 02 0x000000 0x800000 0x020000 0x030000 program space the address for the table operation is determined by the data ea within the page defined by the tblpag register. only read operations are shown; wr ite operations are also valid in the user memory area.
? 2011-2013 microchip technology inc. ds70657g-page 117 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 5.0 flash program memory the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices contain internal flash program memory for storing and executing application code. the memory is readable, writable and erasable during normal operation over the entire v dd range. flash memory can be programmed in two ways: ? in-circuit serial programming? (icsp?) programming capability ? run-time self-programming (rtsp) icsp allows for a dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/ mc20x device to be serially programmed while in the end application circuit. this is done with two lines for programming clock and programming data (one of the alternate programming pin pairs: pgecx/pgedx), and three other lines for power (v dd ), ground (v ss ) and master clear (mclr ). this allows customers to manufacture boards with unprogrammed devices and then program the device just before shipping the product. this also allows the most recent firmware or a custom firmware to be programmed. rtsp is accomplished using tblrd (table read) and tblwt (table write) instructions. with rtsp, the user application can write program memory data a single program memory word, and erase program memory in blocks or ?pages? of 1024 instructions (3072 bytes) at a time. 5.1 table instructions and flash programming regardless of the method used, all programming of flash memory is done with the table read and table write instructions. these allow direct read and write access to the program memory space from the data memory while the device is in normal operating mode. the 24-bit target address in the program memory is formed using bits<7:0> of the tblpag register and the effective address (ea) from a w register, specified in the table instruction, as shown in figure 5-1 . the tblrdl and the tblwtl instructions are used to read or write to bits<15:0> of program memory. tblrdl and tblwtl can access program memory in both word and byte modes. the tblrdh and tblwth instructions are used to read or write to bits<23:16> of program memory. tblrdh and tblwth can also access program memory in word or byte mode. figure 5-1: addressing for table registers note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to section 5. ?flash programming? (ds70609) of the ?dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. 0 program counter 24 bits program counter tblpag reg 8 bits working reg ea 16 bits byte 24-bit ea 0 1/0 select using table instruction using user/configuration space select
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 118 ? 2011-2013 microchip technology inc. 5.2 rtsp operation rtsp allows the user application to erase a single page of memory and to program two instruction words at a time. see the general purpose and motor control family tables (table 1 and tab l e 2 , respectively) for the page sizes of each device. for more information on erasing and programming flash memory, refer to section 5. ?flash program- ming? (ds70609) in the ?dspic33e/pic24e family reference manual? . 5.3 programming operations a complete programming sequence is necessary for programming or erasing the internal flash in rtsp mode. the processor stalls (waits) until the programming operation is finished. for erase and program times, refer to parameters d137a and d137b (page erase time), and d138a and d138b (word write cycle time) in table 30-14 in section 30.0 ?electrical characteristics? . setting the wr bit (nvmcon<15>) starts the opera- tion and the wr bit is automatically cleared when the operation is finished. 5.3.1 programming algorithm for flash program memory programmers can program two adjacent words (24 bits x 2) of program flash memory at a time on every other word address boundary (0x000002, 0x000006, 0x00000a, etc.). to do this, it is necessary to erase the page that contains the desired address of the location the user wants to change. for protection against accidental operations, the write initiate sequence for nvmkey must be used to allow any erase or program operation to proceed. after the programming command has been executed, the user application must wait for the programming time until programming is complete. the two instructions follow- ing the start of the programming sequence should be nop s. refer to section 5. ?flash programming? (ds70609) in the ? dspic33e/pic24e family reference manual ? for details and codes examples on programming using rtsp. 5.4 flash memory resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 5.4.1 key resources ? section 5. ?flash programming? (ds70609) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools 5.5 control registers four sfrs are used to read and write the program flash memory: nvmcon, nvmkey, nvmadru and nvmadr. the nvmcon register ( register 5-1 ) controls which blocks are to be erased, which memory type is to be programmed and the start of the programming cycle. nvmkey ( register 5-4 ) is a write-only register that is used for write protection. to start a programming or erase sequence, the user application must consecutively write 0x55 and 0xaa to the nvmkey register. there are two nvm address registers: nvmadru and nvmadr. these two registers, when concatenated, form the 24-bit effective address (ea) of the selected word for programming operations or the selected page for erase operations. the nvmadru register is used to hold the upper 8 bits of the ea, while the nvmadr register is used to hold the lower 16 bits of the ea. note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 119 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 5-1: nvmcon: nonvolatil e memory (nvm) control register r/so-0 ( 1 ) r/w-0 ( 1 ) r/w-0 ( 1 ) r/w-0 u-0 u-0 u-0 u-0 wr wren wrerr nvmsidl ( 2 ) ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r/w-0 ( 1 ) r/w-0 ( 1 ) r/w-0 ( 1 ) r/w-0 ( 1 ) ? ? ? ?nvmop<3:0> ( 3 , 4 ) bit 7 bit 0 legend: so = settable only bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 wr: write control bit ( 1 ) 1 = initiates a flash memory program or erase operation; the operation is self-timed and the bit is cleared by hardware once the operation is complete 0 = program or erase operation is complete and inactive bit 14 wren: write enable bit ( 1 ) 1 = enables flash program/erase operations 0 = inhibits flash program/erase operations bit 13 wrerr: write sequence error flag bit ( 1 ) 1 = an improper program or erase sequence attempt or termination has occurred (bit is set automatically on any set attempt of the wr bit) 0 = the program or erase operation completed normally bit 12 nvmsidl: nvm stop in idle control bit ( 2 ) 1 = flash voltage regulator goes into standby mode during idle mode 0 = flash voltage regulator is active during idle mode bit 11-4 unimplemented: read as ? 0 ? bit 3-0 nvmop<3:0>: nvm operation select bits ( 1 , 3 , 4 ) 1111 = reserved 1110 = reserved 1101 = reserved 1100 = reserved 1011 = reserved 1010 = reserved 0011 = memory page erase operation 0010 = reserved 0001 = memory double-word program operation ( 5 ) 0000 = reserved note 1: these bits can only be reset on a por. 2: if this bit is set, there will be minimal power savings (i idle ) and upon exiting idle mode, there is a delay (t vreg ) before flash memory becomes operational. 3: all other combinations of nvmop<3:0> are unimplemented. 4: execution of the pwrsav instruction is ignored while any of the nvm operations are in progress. 5: two adjacent words on a 4-word boundary are programmed during execution of this operation.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 120 ? 2011-2013 microchip technology inc. register 5-4: nvmkey: nonvol atile memory key register register 5-2: nvmadru: nonvolatile memory upper address register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadru<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 nvmadru<7:0>: nonvolatile memory upper write address bits selects the upper 8 bits of the location to program or erase in program flash memory. this register may be read or written by the user application. register 5-3: nvmadr: nonvolatil e memory lower address register r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadr<15:8> bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 nvmadr<15:0>: nonvolatile memory lower write address bits selects the lower 16 bits of the location to program or erase in program flash memory. this register may be read or written by the user application. u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 w-0 w-0 w-0 w-0 w-0 w-0 w-0 w-0 nvmkey<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 nvmkey<7:0>: key register (write-only) bits
? 2011-2013 microchip technology inc. ds70657g-page 121 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 6.0 resets the reset module combines all reset sources and controls the device master reset signal, sysrst . the following is a list of device reset sources: ? por: power-on reset ? bor: brown-out reset ?mclr : master clear pin reset ?swr: reset instruction ? wdto: watchdog timer time-out reset ? cm: configuration mismatch reset ? trapr: trap conflict reset ? iopuwr: illegal condition device reset - illegal opcode reset - uninitialized w register reset - security reset a simplified block diagram of the reset module is shown in figure 6-1 . any active source of reset will make the sysrst signal active. on system reset, some of the registers associated with the cpu and peripherals are forced to a known reset state and some are unaffected. all types of device reset set a corresponding status bit in the rcon register to indicate the type of reset (see register 6-1 ). a por clears all the bits, except for the por and bor bits (rcon<1:0>), that are set. the user application can set or clear any bit at any time during code execution. the rcon bits only serve as status bits. setting a particular reset status bit in software does not cause a device reset to occur. the rcon register also has other bits associated with the watchdog timer and device power-saving states. the function of these bits is discussed in other sections of this manual. for all resets, the default clock source is determined by the fnosc<2:0> bits in the foscsel configura- tion register. the value of the fnosc<2:0> bits is loaded into nosc<2:0> (osccon<10:8>) on reset, which in turn, initializes the system clock. figure 6-1: reset sy stem block diagram note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to section 8. ?reset? (ds70602) of the ?dspic33e/pic24e family reference manual? , which is available from the micro- chip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: refer to the specific peripheral section or section 4.0 ?memory organization? of this manual for register reset states. note: the status bits in the rcon register should be cleared after they are read so that the next rcon register value after a device reset is meaningful. mclr v dd bor sleep or idle reset instruction wdt module glitch filter trap conflict illegal opcode uninitialized w register sysrst v dd rise detect por configuration mismatch security reset internal regulator
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 122 ? 2011-2013 microchip technology inc. 6.1 reset resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 6.1.1 key resources ? section 8. ?reset? (ds70602) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 123 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 6-1: rcon: re set control register ( 1 ) r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 r/w-0 r/w-0 trapr iopuwr ? ?vregsf ?cmvregs bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-1 extr swr swdten ( 2 ) wdto sleep idle bor por bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 trapr: trap reset flag bit 1 = a trap conflict reset has occurred 0 = a trap conflict reset has not occurred bit 14 iopuwr: illegal opcode or uninitialized w access reset flag bit 1 = an illegal opcode detection, an illegal address mode or uninitialized w register used as an address pointer caused a reset 0 = an illegal opcode or uninitialized w register reset has not occurred bit 13-12 unimplemented: read as ? 0 ? bit 11 vregsf: flash voltage regulator standby during sleep bit 1 = flash voltage regulator is active during sleep 0 = flash voltage regulator goes into standby mode during sleep bit 10 unimplemented: read as ? 0 ? bit 9 cm: configuration mismatch flag bit 1 = a configuration mismatch reset has occurred. 0 = a configuration mismatch reset has not occurred bit 8 vregs: voltage regulator standby during sleep bit 1 = voltage regulator is active during sleep 0 = voltage regulator goes into standby mode during sleep bit 7 extr: external reset (mclr ) pin bit 1 = a master clear (pin) reset has occurred 0 = a master clear (pin) reset has not occurred bit 6 swr: software reset (instruction) flag bit 1 = a reset instruction has been executed 0 = a reset instruction has not been executed bit 5 swdten: software enable/disable of wdt bit ( 2 ) 1 = wdt is enabled 0 = wdt is disabled bit 4 wdto: watchdog timer time-out flag bit 1 = wdt time-out has occurred 0 = wdt time-out has not occurred note 1: all of the reset status bits can be set or cleared in software. setting one of these bits in software does not cause a device reset. 2: if the fwdten configuration bit is ? 1 ? (unprogrammed), the wdt is always enabled, regardless of the swdten bit setting.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 124 ? 2011-2013 microchip technology inc. bit 3 sleep: wake-up from sleep flag bit 1 = device has been in sleep mode 0 = device has not been in sleep mode bit 2 idle: wake-up from idle flag bit 1 = device was in idle mode 0 = device was not in idle mode bit 1 bor: brown-out reset flag bit 1 = a brown-out reset has occurred 0 = a brown-out reset has not occurred bit 0 por: power-on reset flag bit 1 = a power-on reset has occurred 0 = a power-on reset has not occurred register 6-1: rcon: re set control register ( 1 ) (continued) note 1: all of the reset status bits can be set or cleared in software. setting one of these bits in software does not cause a device reset. 2: if the fwdten configuration bit is ? 1 ? (unprogrammed), the wdt is always enabled, regardless of the swdten bit setting.
? 2011-2013 microchip technology inc. ds70657g-page 125 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 7.0 interrupt controller the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x interrupt controller reduces the numerous peripheral interrupt request sig- nals to a single interrupt request signal to the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x cpu. the interrupt controller has the following features: ? up to eight processor exceptions and software traps ? eight user-selectable priority levels ? interrupt vector table (ivt) with a unique vector for each interrupt or exception source ? fixed priority within a specified user priority level ? fixed interrupt entry and return latencies 7.1 interrupt vector table the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x interrupt vector table (ivt), shown in figure 7-1 , resides in program memory starting at location, 000004h. the ivt contains seven non-maskable trap vectors and up to 246 sources of interrupt. in general, each interrupt source has its own vector. each interrupt vector contains a 24-bit-wide address. the value programmed into each interrupt vector location is the starting address of the associated interrupt service routine (isr). interrupt vectors are prioritized in terms of their natural priority. this priority is linked to their position in the vector table. lower addresses generally have a higher natural priority. for example, the interrupt associated with vector 0 takes priority over interrupts at any other vector address. 7.2 reset sequence a device reset is not a true exception because the interrupt controller is not involved in the reset process. the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices clear their registers in response to a reset, which forces the pc to zero. the device then begins program execution at location, 0x000000. a goto instruction at the reset address can redirect program execution to the appropriate start-up routine. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 6. ?interrupts? (ds70600) of the ? dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: any unimplemented or unused vector locations in the ivt should be programmed with the address of a default interrupt handler routine that contains a reset instruction.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 126 ? 2011-2013 microchip technology inc. figure 7-1: dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x interrupt vector table ivt decreasing natural order priority reset ? goto instruction 0x000000 reset ? goto address 0x000002 oscillator fail trap vector 0x000004 address error trap vector 0x000006 generic hard trap vector 0x000008 stack error trap vector 0x00000a math error trap vector 0x00000c dmac error trap vector 0x00000e generic soft trap vector 0x000010 reserved 0x000012 interrupt vector 0 0x000014 interrupt vector 1 0x000016 :: :: :: interrupt vector 52 0x00007c interrupt vector 53 0x00007e interrupt vector 54 0x000080 :: :: :: interrupt vector 116 0x0000fc interrupt vector 117 0x0000fe interrupt vector 118 0x000100 interrupt vector 119 0x000102 interrupt vector 120 0x000104 :: :: :: interrupt vector 244 0x0001fc interrupt vector 245 0x0001fe start of code 0x000200 see ta b l e 7 - 1 for interrupt vector details
? 2011-2013 microchip technology inc. ds70657g-page 127 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 7-1: interrupt vector details interrupt source vector # irq # ivt address interrupt bit location flag enable priority highest natural order priority int0 ? external interrupt 0 8 0 0x000014 ifs0<0> iec0<0> ipc0<2:0> ic1 ? input capture 1 9 1 0x000016 ifs0<1> iec0<1> ipc0<6:4> oc1 ? output compare 1 10 2 0x000018 ifs0<2> iec0<2> ipc0<10:8> t1 ? timer1 11 3 0x00001a ifs0<3> iec0<3> ipc0<14:12> dma0 ? dma channel 0 12 4 0x00001c ifs0<4> iec0<4> ipc1<2:0> ic2 ? input capture 2 13 5 0x00001e ifs0<5> iec0<5> ipc1<6:4> oc2 ? output compare 2 14 6 0x000020 ifs0<6> iec0<6> ipc1<10:8> t2 ? timer2 15 7 0x000022 ifs0<7> iec0<7> ipc1<14:12> t3 ? timer3 16 8 0x000024 ifs0<8> iec0<8> ipc2<2:0> spi1e ? spi1 error 17 9 0x000026 ifs0<9> iec0<9> ipc2<6:4> spi1 ? spi1 transfer done 18 10 0x000028 ifs0<10> iec0<10> ipc2<10:8> u1rx ? uart1 receiver 19 11 0x00002a ifs0<11> iec0<11> ipc2<14:12> u1tx ? uart1 transmitter 20 12 0x00002c ifs0<12> iec0<12> ipc3<2:0> ad1 ? adc1 convert done 21 13 0x00002e ifs0<13> iec0<13> ipc3<6:4> dma1 ? dma channel 1 22 14 0x000030 ifs0<14> iec0<14> ipc3<10:8> reserved 23 15 0x000032 ? ? ? si2c1 ? i2c1 slave event 24 16 0x000034 ifs1<0> iec1<0> ipc4<2:0> mi2c1 ? i2c1 master event 25 17 0x000036 ifs1<1> iec1<1> ipc4<6:4> cm ? comparator combined event 26 18 0x000038 ifs1<2> iec1<2> ipc4<10:8> cn ? input change interrupt 27 19 0x00003a ifs1<3> iec1<3> ipc4<14:12> int1 ? external interrupt 1 28 20 0x00003c ifs1<4> iec1<4> ipc5<2:0> reserved 29-31 21-23 0x00003e-0x000042 ? ? ? dma2 ? dma channel 2 32 24 0x000044 ifs1<8> iec1<8> ipc6<2:0> oc3 ? output compare 3 33 25 0x000046 ifs1<9> iec1<9> ipc6<6:4> oc4 ? output compare 4 34 26 0x000048 ifs1<10> iec1<10> ipc6<10:8> t4 ? timer4 35 27 0x00004a ifs1<11> iec1<11> ipc6<14:12> t5 ? timer5 36 28 0x00004c ifs1<12> iec1<12> ipc7<2:0> int2 ? external interrupt 2 37 29 0x00004e ifs1<13> iec1<13> ipc7<6:4> u2rx ? uart2 receiver 38 30 0x000050 ifs1<14> iec1<14> ipc7<10:8> u2tx ? uart2 transmitter 39 31 0x000052 ifs1<15> iec1<15> ipc7<14:12> spi2e ? spi2 error 40 32 0x000054 ifs2<0> iec2<0> ipc8<2:0> spi2 ? spi2 transfer done 41 33 0x000056 ifs2<1> iec2<1> ipc8<6:4> c1rx ? can1 rx data ready ( 1 ) 42 34 0x000058 ifs2<2> iec2<2> ipc8<10:8> c1 ? can1 event ( 1 ) 43 35 0x00005a ifs2<3> iec2<3> ipc8<14:12> dma3 ? dma channel 3 44 36 0x00005c ifs2<4> iec2<4> ipc9<2:0> ic3 ? input capture 3 45 37 0x00005e ifs2<5> iec2<5> ipc9<6:4> ic4 ? input capture 4 46 38 0x000060 ifs2<6> iec2<6> ipc9<10:8> reserved 47-56 39-48 0x000062-0x000074 ? ? ? si2c2 ? i2c2 slave event 57 49 0x000076 ifs3<1> iec3<1> ipc12<6:4> mi2c2 ? i2c2 master event 58 50 0x000078 ifs3<2> iec3<2> ipc12<10:8> reserved 59-64 51-56 0x00007a-0x000084 ? ? ? psem ? pwm special event match ( 2 ) 65 57 0x000086 ifs3<9> iec3<9> ipc14<6:4> note 1: this interrupt source is available on dspic33epxxxgp50x and dspic33epxxxmc50x devices only. 2: this interrupt source is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 128 ? 2011-2013 microchip technology inc. qei1 ? qei1 position counter compare ( 2 ) 66 58 0x000088 ifs3<10> iec3<10> ipc14<10:8> reserved 67-72 59-64 0x00008a-0x000094 ? ? ? u1e ? uart1 error interrupt 73 65 0x000096 ifs4<1> iec4<1> ipc16<6:4> u2e ? uart2 error interrupt 74 66 0x000098 ifs4<2> iec4<2> ipc16<10:8> crc ? crc generator interrupt 75 67 0x00009a ifs4<3> iec4<3> ipc16<14:12> reserved 76-77 68-69 0x00009c-0x00009e ? ? ? c1tx ? can1 tx data request ( 1 ) 78 70 0x000a0 ifs4<6> iec4<6> ipc17<10:8> reserved 79-84 71-76 0x0000a2-0x0000ac ? ? ? ctmu ? ctmu interrupt 85 77 0x0000ae ifs4<13> iec4<13> ipc19<6:4> reserved 86-101 78-93 0x0000b0-0x0000ce ? ? ? pwm1 ? pwm generator 1 ( 2 ) 102 94 0x0000d0 ifs5<14> iec5<14> ipc23<10:8> pwm2 ? pwm generator 2 ( 2 ) 103 95 0x0000d2 ifs5<15> iec5<15> ipc23<14:12> pwm3 ? pwm generator 3 ( 2 ) 104 96 0x0000d4 ifs6<0> iec6<0> ipc24<2:0> reserved 105-149 97-141 0x0001d6-0x00012e ? ? ? icd ? icd application 150 142 0x000142 ifs8<14> iec8<14> ipc35<10:8> jtag ? jtag programming 151 143 0x000130 ifs8<15> iec8<15> ipc35<14:12> reserved 152 144 0x000134 ? ? ? ptgstep ? ptg step 153 145 0x000136 ifs9<1> iec9<1> ipc36<6:4> ptgwdt ? ptg watchdog time-out 154 146 0x000138 ifs9<2> iec9<2> ipc36<10:8> ptg0 ? ptg interrupt 0 155 147 0x00013a ifs9<3> iec9<3> ipc36<14:12> ptg1 ? ptg interrupt 1 156 148 0x00013c ifs9<4> iec9<4> ipc37<2:0> ptg2 ? ptg interrupt 2 157 149 0x00013e ifs9<5> iec9<5> ipc37<6:4> ptg3 ? ptg interrupt 3 158 150 0x000140 ifs9<6> iec9<6> ipc37<10:8> reserved 159-245 151-245 0x000142-0x0001fe ? ? ? lowest natural order priority table 7-1: interrupt vector details (continued) interrupt source vector # irq # ivt address interrupt bit location flag enable priority note 1: this interrupt source is available on dspic33epxxxgp50x and dspic33epxxxmc50x devices only. 2: this interrupt source is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 129 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 7.3 interrupt resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 7.3.1 key resources ? section 6. ?interrupts? (ds70600) ? code samples ? application notes ? software libraries ?webinars ?all related ?dspic33e/pic24e family reference manual? sections ? development tools 7.4 interrupt control and status registers dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices implement the following registers for the interrupt controller: ? intcon1 ? intcon2 ? intcon3 ? intcon4 ?inttreg 7.4.1 intcon1 through intcon4 global interrupt control functions are controlled from intcon1, intcon2, intcon3 and intcon4. intcon1 contains the interrupt nesting disable bit, (nstdis) as well as the control and status flags for the processor trap sources. the intcon2 register controls external interrupt request signal behavior and also contains the global interrupt enable bit (gie). intcon3 contains the status flags for the dma and do stack overflow status trap sources. the intcon4 register contains the software generated hard trap status bit (sght). 7.4.2 ifsx the ifsx registers maintain all of the interrupt request flags. each source of interrupt has a status bit, which is set by the respective peripherals or external signal and is cleared via software. 7.4.3 iecx the iecx registers maintain all of the interrupt enable bits. these control bits are used to individually enable interrupts from the peripherals or external signals. 7.4.4 ipcx the ipcx registers are used to set the interrupt priority level (ipl) for each source of interrupt. each user interrupt source can be assigned to one of eight priority levels. 7.4.5 inttreg the inttreg register contains the associated interrupt vector number and the new cpu interrupt priority level, which are latched into vector number (vecnum<7:0>) and interrupt level bit (ilr<3:0>) fields in the inttreg register. the new interrupt priority level is the priority of the pending interrupt. the interrupt sources are assigned to the ifsx, iecx and ipcx registers in the same sequence as they are listed in table 7-1 . for example, the int0 (external interrupt 0) is shown as having vector number 8 and a natural order priority of 0. thus, the int0if bit is found in ifs0<0>, the int0ie bit in iec0<0> and the int0ip bits in the first position of ipc0 (ipc0<2:0>). 7.4.6 status/control registers although these registers are not specifically part of the interrupt control hardware, two of the cpu control registers contain bits that control interrupt functionality. for more information on these registers refer to section 2. ?cpu? (ds70359) in the ?dspic33e/ pic24e family reference manual? . ? the cpu status register, sr, contains the ipl<2:0> bits (sr<7:5>). these bits indicate the current cpu interrupt priority level. the user software can change the current cpu interrupt priority level by writing to the iplx bits. ? the corcon register contains the ipl3 bit which, together with ipl<2:0>, also indicates the current cpu priority level. ipl3 is a read-only bit so that trap events cannot be masked by the user software. all interrupt registers are described in register 7-3 through register 7-7 in the following pages. note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 130 ? 2011-2013 microchip technology inc. register 7-1: sr: cpu status register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/c-0 r/c-0 r-0 r/w-0 oa ob sa sb oab sab da dc bit 15 bit 8 r/w-0 ( 3 ) r/w-0 ( 3 ) r/w-0 ( 3 ) r-0 r/w-0 r/w-0 r/w-0 r/w-0 ipl<2:0> ( 2 ) ra n ov z c bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1?= bit is set ?0? = bit is cleared x = bit is unknown bit 7-5 ipl<2:0>: cpu interrupt priority level status bits ( 2 , 3 ) 111 = cpu interrupt priority level is 7 (15); user interrupts are disabled 110 = cpu interrupt priority level is 6 (14) 101 = cpu interrupt priority level is 5 (13) 100 = cpu interrupt priority level is 4 (12) 011 = cpu interrupt priority level is 3 (11) 010 = cpu interrupt priority level is 2 (10) 001 = cpu interrupt priority level is 1 (9) 000 = cpu interrupt priority level is 0 (8) note 1: for complete register details, see register 3-1 . 2: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read-only when the nstdis bit (intcon1<15>) = 1 .
? 2011-2013 microchip technology inc. ds70657g-page 131 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 7-2: corcon: core control register ( 1 ) r/w-0 u-0 r/w-0 r/w-0 r/w-0 r-0 r-0 r-0 var ? us<1:0> edt dl<2:0> bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-0 r/c-0 r-0 r/w-0 r/w-0 sata satb satdw accsat ipl3 ( 2 ) sfa rnd if bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1?= bit is set ?0? = bit is cleared x = bit is unknown bit 15 var: variable exception processing latency control bit 1 = variable exception processing is enabled 0 = fixed exception processing is enabled bit 3 ipl3: cpu interrupt priority level status bit 3 ( 2 ) 1 = cpu interrupt priority level is greater than 7 0 = cpu interrupt priority level is 7 or less note 1: for complete register details, see register 3-2 . 2: the ipl3 bit is concatenated with the ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 132 ? 2011-2013 microchip technology inc. register 7-3: intcon1: in terrupt control register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nstdis ovaerr ( 1 ) ovberr ( 1 ) covaerr ( 1 ) covberr ( 1 ) ovate ( 1 ) ovbte ( 1 ) covte ( 1 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 sftacerr ( 1 ) div0err dmacerr matherr addrerr stkerr oscfail ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 nstdis: interrupt nesting disable bit 1 = interrupt nesting is disabled 0 = interrupt nesting is enabled bit 14 ovaerr: accumulator a overflow trap flag bit ( 1 ) 1 = trap was caused by overflow of accumulator a 0 = trap was not caused by overflow of accumulator a bit 13 ovberr: accumulator b overflow trap flag bit ( 1 ) 1 = trap was caused by overflow of accumulator b 0 = trap was not caused by overflow of accumulator b bit 12 covaerr: accumulator a catastrophic overflow trap flag bit ( 1 ) 1 = trap was caused by catastrophic overflow of accumulator a 0 = trap was not caused by catastrophic overflow of accumulator a bit 11 covberr: accumulator b catastrophic overflow trap flag bit ( 1 ) 1 = trap was caused by catastrophic overflow of accumulator b 0 = trap was not caused by catastrophic overflow of accumulator b bit 10 ovate: accumulator a overflow trap enable bit ( 1 ) 1 = trap overflow of accumulator a 0 = trap is disabled bit 9 ovbte: accumulator b overflow trap enable bit ( 1 ) 1 = trap overflow of accumulator b 0 = trap is disabled bit 8 covte: catastrophic overflow trap enable bit ( 1 ) 1 = trap on catastrophic overflow of accumulator a or b enabled 0 = trap is disabled bit 7 sftacerr: shift accumulator error status bit ( 1 ) 1 = math error trap was caused by an invalid accumulator shift 0 = math error trap was not caused by an invalid accumulator shift bit 6 div0err: divide-by-zero error status bit 1 = math error trap was caused by a divide-by-zero 0 = math error trap was not caused by a divide-by-zero bit 5 dmacerr: dmac trap flag bit 1 = dmac trap has occurred 0 = dmac trap has not occurred note 1: these bits are available on dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 133 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 4 matherr: math error status bit 1 = math error trap has occurred 0 = math error trap has not occurred bit 3 addrerr: address error trap status bit 1 = address error trap has occurred 0 = address error trap has not occurred bit 2 stkerr: stack error trap status bit 1 = stack error trap has occurred 0 = stack error trap has not occurred bit 1 oscfail: oscillator failure trap status bit 1 = oscillator failure trap has occurred 0 = oscillator failure trap has not occurred bit 0 unimplemented: read as ? 0 ? register 7-3: intcon1: interrupt control register 1 (continued) note 1: these bits are available on dspic33epxxxmc20x/50x and dspic33epxxxgp50x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 134 ? 2011-2013 microchip technology inc. register 7-4: intcon2: in terrupt control register 2 r/w-1 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 gie disi swtrap ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? int2ep int1ep int0ep bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 gie: global interrupt enable bit 1 = interrupts and associated ie bits are enabled 0 = interrupts are disabled, but traps are still enabled bit 14 disi: disi instruction status bit 1 = disi instruction is active 0 = disi instruction is not active bit 13 swtrap: software trap status bit 1 = software trap is enabled 0 = software trap is disabled bit 12-3 unimplemented: read as ? 0 ? bit 2 int2ep: external interrupt 2 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 1 int1ep: external interrupt 1 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 0 int0ep: external interrupt 0 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge
? 2011-2013 microchip technology inc. ds70657g-page 135 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 7-5: intcon3: in terrupt control register 3 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 ? ?daedoovr ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as ? 0 ? bit 5 dae: dma address error soft trap status bit 1 = dma address error soft trap has occurred 0 = dma address error soft trap has not occurred bit 4 doovr: do stack overflow soft trap status bit 1 = do stack overflow soft trap has occurred 0 = do stack overflow soft trap has not occurred bit 3-0 unimplemented: read as ? 0 ? register 7-6: intcon4: in terrupt control register 4 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 ? ? ? ? ? ? ?sght bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-1 unimplemented: read as ? 0 ? bit 0 sght: software generated hard trap status bit 1 = software generated hard trap has occurred 0 = software generated hard trap has not occurred
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 136 ? 2011-2013 microchip technology inc. register 7-7: inttreg: interrupt control and status register u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ?ilr<3:0> bit 15 bit 8 u-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 vecnum<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-8 ilr<3:0>: new cpu interrupt priority level bits 1111 = cpu interrupt priority level is 15 ? ? ? 0001 = cpu interrupt priority level is 1 0000 = cpu interrupt priority level is 0 bit 7-0 vecnum<7:0>: vector number of pending interrupt bits 11111111 = 255, reserved; do not use ? ? ? 00001001 = 9, ic1 ? input capture 1 00001000 = 8, int0 ? external interrupt 0 00000111 = 7, reserved; do not use 00000110 = 6, generic soft error trap 00000101 = 5, dmac error trap 00000100 = 4, math error trap 00000011 = 3, stack error trap 00000010 = 2, generic hard trap 00000001 = 1, address error trap 00000000 = 0, oscillator fail trap
? 2011-2013 microchip technology inc. ds70657g-page 137 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 8.0 direct memory access (dma) the dma controller transfers data between peripheral data registers and data space sram in addition, dma can access the entire data memory space. the data memory bus arbiter is utilized when either the cpu or dma attempts to access sram, resulting in potential dma or cpu stalls. the dma controller supports 4 independent channels. each channel can be configured for transfers to or from selected peripherals. some of the peripherals supported by the dma controller include: ? ecan? ? analog-to-digital converter (adc) ? serial peripheral interface (spi) ?uart ? input capture ? output compare refer to tab le 8 -1 for a complete list of supported peripherals. figure 8-1: dma controller note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to section 22. ?direct memory access (dma)? (ds70348) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. dma peripheral data memory sram (see figure 4-18 ) arbiter
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 138 ? 2011-2013 microchip technology inc. in addition, dma transfers can be triggered by timers as well as external interrupts. each dma channel is unidirectional. two dma channels must be allocated to read and write to a peripheral. if more than one channel receives a request to transfer data, a simple fixed priority scheme based on channel number, dictates which channel completes the transfer and which channel, or channels, are left pending. each dma channel moves a block of data, after which, it generates an interrupt to the cpu to indicate that the block is available for processing. the dma controller provides these functional capabilities: ? four dma channels ? register indirect with post-increment addressing mode ? register indirect without post-increment addressing mode ? peripheral indirect addressing mode (peripheral generates destination address) ? cpu interrupt after half or full block transfer complete ? byte or word transfers ? fixed priority channel arbitration ? manual (software) or automatic (peripheral dma requests) transfer initiation ? one-shot or auto-repeat block transfer modes ? ping-pong mode (automatic switch between two sram start addresses after each block transfer is complete) ? dma request for each channel can be selected from any supported interrupt source ? debug support features the peripherals that can utilize dma are listed in table 8-1 . table 8-1: dma channel to pe ripheral associations peripheral to dma association dmaxreq register irqsel<7:0> bits dmaxpad register (values to read from peripheral) dmaxpad register (values to write to peripheral) int0 ? external interrupt 0 00000000 ?? ic1 ? input capture 1 00000001 0x0144 (ic1buf) ? ic2 ? input capture 2 00000101 0x014c (ic2buf) ? ic3 ? input capture 3 00100101 0x0154 (ic3buf) ? ic4 ? input capture 4 00100110 0x015c (ic4buf) ? oc1 ? output compare 1 00000010 ? 0x0906 (oc1r) 0x0904 (oc1rs) oc2 ? output compare 2 00000110 ? 0x0910 (oc2r) 0x090e (oc2rs) oc3 ? output compare 3 00011001 ? 0x091a (oc3r) 0x0918 (oc3rs) oc4 ? output compare 4 00011010 ? 0x0924 (oc4r) 0x0922 (oc4rs) tmr2 ? timer2 00000111 ?? tmr3 ? timer3 00001000 ?? tmr4 ? timer4 00011011 ?? tmr5 ? timer5 00011100 ?? spi1 transfer done 00001010 0x0248 (spi1buf) 0x0248 (spi1buf) spi2 transfer done 00100001 0x0268 (spi2buf) 0x0268 (spi2buf) uart1rx ? uart1 receiver 00001011 0x0226 (u1rxreg) ? uart1tx ? uart1 transmitter 00001100 ? 0x0224 (u1txreg) uart2rx ? uart2 receiver 00011110 0x0236 (u2rxreg) ? uart2tx ? uart2 transmitter 00011111 ? 0x0234 (u2txreg) ecan1 ? rx data ready 00100010 0x0440 (c1rxd) ? ecan1 ? tx data request 01000110 ? 0x0442 (c1txd) adc1 ? adc1 convert done 00001101 0x0300 (adc1buf0) ?
? 2011-2013 microchip technology inc. ds70657g-page 139 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 8-2: dma controller block diagram 8.1 dma resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 8.1.1 key resources ? section 22. ?direct memory access (dma)? (ds70348) ? code samples ? application notes ? software libraries ?webinars ?all related ?dspic33e/pic24e family reference manual? sections ? development tools 8.2 dmac registers each dmac channel x (where x = 0 through 3) contains the following registers: ? 16-bit dma channel control register (dmaxcon) ? 16-bit dma channel irq select register (dmaxreq) ? 32-bit dma ram primary start address register (dmaxsta) ? 32-bit dma ram secondary start address register (dmaxstb) ? 16-bit dma peripheral address register (dmaxpad) ? 14-bit dma transfer count register (dmaxcnt) additional status registers (dmapwc, dmarqc, dmapps, dmalca and dsadr) are common to all dmac channels. these status registers provide infor- mation on write and request collisions, as well as on last address and channel access information. the interrupt flags (dmaxif) are located in an ifsx register in the interrupt controller. the corresponding interrupt enable control bits (dmaxie) are located in an iecx register in the interrupt controller, and the corresponding interrupt priority control bits (dmaxip) are located in an ipcx register in the interrupt controller. cpu arbiter peripheral non-dma dma x-bus peripheral indirect address dma control dma controller dma cpu peripheral x-bus irq to dma and interrupt controller modules irq to dma and interrupt controller modules irq to dma and interrupt controller modules 0123 sram channels peripheral 1 dma ready cpu dma peripheral 3 dma ready cpu dma peripheral 2 dma ready cpu dma note: cpu and dma address buses ar e not shown for clarity. note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 140 ? 2011-2013 microchip technology inc. register 8-1: dma x con: dma channel x control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 chen size dir half nullw ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 ? ?amode<1:0> ? ?mode<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 chen: dma channel enable bit 1 = channel is enabled 0 = channel is disabled bit 14 size: dma data transfer size bit 1 =byte 0 =word bit 13 dir: dma transfer direction bit (source/destination bus select) 1 = reads from ram address, writes to peripheral address 0 = reads from peripheral address, writes to ram address bit 12 half: dma block transfer interrupt select bit 1 = initiates interrupt when half of the data has been moved 0 = initiates interrupt when all of the data has been moved bit 11 nullw: null data peripheral write mode select bit 1 = null data write to peripheral in addition to ram write (dir bit must also be clear) 0 = normal operation bit 10-6 unimplemented: read as ? 0 ? bit 5-4 amode<1:0>: dma channel addressing mode select bits 11 = reserved 10 = peripheral indirect addressing mode 01 = register indirect without post-increment mode 00 = register indirect with post-increment mode bit 3-2 unimplemented: read as ? 0 ? bit 1-0 mode<1:0>: dma channel operating mode select bits 11 = one-shot, ping-pong modes are enabled (one block transfer from/to each dma buffer) 10 = continuous, ping-pong modes are enabled 01 = one-shot, ping-pong modes are disabled 00 = continuous, ping-pong modes are disabled
? 2011-2013 microchip technology inc. ds70657g-page 141 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 8-2: dma x req: dma channel x irq select register r/s-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 force ( 1 ) ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 irqsel<7:0> bit 7 bit 0 legend: s = settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 force: force dma transfer bit ( 1 ) 1 = forces a single dma transfer (manual mode) 0 = automatic dma transfer initiation by dma request bit 14-8 unimplemented: read as ? 0 ? bit 7-0 irqsel<7:0>: dma peripheral irq number select bits 01000110 = ecan1 ? tx data request ( 2 ) 00100110 = ic4 ? input capture 4 00100101 = ic3 ? input capture 3 00100010 = ecan1 ? rx data ready ( 2 ) 00100001 = spi2 transfer done 00011111 = uart2tx ? uart2 transmitter 00011110 = uart2rx ? uart2 receiver 00011100 = tmr5 ? timer5 00011011 = tmr4 ? timer4 00011010 = oc4 ? output compare 4 00011001 = oc3 ? output compare 3 00001101 = adc1 ? adc1 convert done 00001100 = uart1tx ? uart1 transmitter 00001011 = uart1rx ? uart1 receiver 00001010 = spi1 ? transfer done 00001000 = tmr3 ? timer3 00000111 = tmr2 ? timer2 00000110 = oc2 ? output compare 2 00000101 = ic2 ? input capture 2 00000010 = oc1 ? output compare 1 00000001 = ic1 ? input capture 1 00000000 = int0 ? external interrupt 0 note 1: the force bit cannot be cleared by user software. the force bit is cleared by hardware when the forced dma transfer is complete or the channel is disabled (chen = 0 ). 2: this selection is available in dspic33epxxxgp/mc50x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 142 ? 2011-2013 microchip technology inc. register 8-3: dma x stah: dma channel x start address register a (high) u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sta<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 sta<23:16>: primary start address bits (source or destination) register 8-4: dma x stal: dma channel x start address register a (low) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sta<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sta<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 sta<15:0>: primary start address bits (source or destination)
? 2011-2013 microchip technology inc. ds70657g-page 143 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 8-5: dma x stbh: dma channel x start address register b (high) u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 stb<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 stb<23:16>: secondary start address bits (source or destination) register 8-6: dma x stbl: dma channel x start address register b (low) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 stb<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 stb<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 stb<15:0>: secondary start address bits (source or destination)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 144 ? 2011-2013 microchip technology inc. register 8-7: dma x pad: dma channel x peripheral address register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pad<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pad<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 pad<15:0>: peripheral address register bits note 1: if the channel is enabled (i.e., active), writes to this register may result in unpredictable behavior of the dma channel and should be avoided. register 8-8: dma x cnt: dma channel x transfer count register ( 1 ) u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? cnt<13:8> ( 2 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 cnt<7:0> ( 2 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-0 cnt<13:0>: dma transfer count register bits ( 2 ) note 1: if the channel is enabled (i.e., active), writes to this register may result in unpredictable behavior of the dma channel and should be avoided. 2: the number of dma transfers = cnt<13:0> + 1.
? 2011-2013 microchip technology inc. ds70657g-page 145 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 8-9: dsadrh: dma most re cent ram high address register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 dsadr<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 dsadr<23:16>: most recent dma address accessed by dma bits register 8-10: dsadrl: dma most recent ram low address register r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 dsadr<15:8> bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 dsadr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 dsadr<15:0>: most recent dma address accessed by dma bits
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 146 ? 2011-2013 microchip technology inc. register 8-11: dmapwc: dma peripheral write collision status register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ? pwcol3 pwcol2 pwcol1 pwcol0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3 pwcol3: dma channel 3 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 2 pwcol2: dma channel 2 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 1 pwcol1: dma channel 1 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 0 pwcol0: dma channel 0 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected
? 2011-2013 microchip technology inc. ds70657g-page 147 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 8-12: dmarqc: dma request collision status register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ? rqcol3 rqcol2 rqcol1 rqcol0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3 rqcol3: dma channel 3 transfer request collision flag bit 1 = user force and interrupt-based request collision detected 0 = no request collision detected bit 2 rqcol2: dma channel 2 transfer request collision flag bit 1 = user force and interrupt-based request collision detected 0 = no request collision detected bit 1 rqcol1: dma channel 1 transfer request collision flag bit 1 = user force and interrupt-based request collision detected 0 = no request collision detected bit 0 rqcol0: dma channel 0 transfer request collision flag bit 1 = user force and interrupt-based request collision detected 0 = no request collision detected
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 148 ? 2011-2013 microchip technology inc. register 8-13: dmalca: dma last channel active status register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r-1 r-1 r-1 r-1 ? ? ? ? lstch<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3-0 lstch<3:0>: last dmac channel active status bits 1111 = no dma transfer has occurred since system reset 1110 = reserved ? ? ? 0100 = reserved 0011 = last data transfer was handled by channel 3 0010 = last data transfer was handled by channel 2 0001 = last data transfer was handled by channel 1 0000 = last data transfer was handled by channel 0
? 2011-2013 microchip technology inc. ds70657g-page 149 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 8-14: dmapps: dma ping-pong status register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ? ppst3 ppst2 ppst1 ppst0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3 ppst3: dma channel 3 ping-pong mode status flag bit 1 = dmastb3 register selected 0 = dmasta3 register selected bit 2 ppst2: dma channel 2 ping-pong mode status flag bit 1 = dmastb2 register selected 0 = dmasta2 register selected bit 1 ppst1: dma channel 1 ping-pong mode status flag bit 1 = dmastb1 register selected 0 = dmasta1 register selected bit 0 ppst0: dma channel 0 ping-pong mode status flag bit 1 = dmastb0 register selected 0 = dmasta0 register selected
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 150 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 151 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 9.0 oscillator configuration the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x oscillator system provides: ? on-chip phase-locked loop (pll) to boost inter- nal operating frequency on select internal and external oscillator sources ? on-the-fly clock switching between various clock sources ? doze mode for system power savings ? fail-safe clock monitor (fscm) that detects clock failure and permits safe application recovery or shutdown ? configuration bits for clock source selection a simplified diagram of the oscillator system is shown in figure 9-1 . figure 9-1: oscillator system diagram note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to section 7. ?oscillator? (ds70580) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note 1: see figure 9-2 for pll and f vco details. 2: if the oscillator is used with xt or hs modes, an external parallel resistor with the value of 1 m ? must be connected. 3: the term, f p , refers to the clock source for all peripherals, while f cy refers to the clock source for the cpu. throughout this document, f cy and f p are used interchangeably, except in the case of doze mode. f p and f cy will be different when doze mode is used with a doze ratio of 1:2 or lower. xtpll, hspll, xt, hs, ec frcdiv<2:0> wdt, pwrt, frcdivn frcdiv16 ecpll, frcpll nosc<2:0> fnosc<2:0> reset frc oscillator lprc oscillator doze<2:0> s3 s1 s2 s1/s3 s7 s6 frc lprc s0 s5 16 clock switch s7 clock fail 2 tun<5:0> pll (1) f cy (3) f osc frcdiv doze fscm poscclk frcclk f vco (1) osc2 osc1 primary oscillator r (2) poscmd<1:0> f p (3) n rosel rodiv<3:0> refclko poscclk rpn f osc reference clock generation
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 152 ? 2011-2013 microchip technology inc. 9.1 cpu clocking system the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x family of devices provides six system clock options: ? fast rc (frc) oscillator ? frc oscillator with phase locked loop (pll) ? frc oscillator with postscaler ? primary (xt, hs or ec) oscillator ? primary oscillator with pll ? low-power rc (lprc) oscillator instruction execution speed or device operating frequency, f cy , is given by equation 9-1 . equation 9-1: device operating frequency figure 9-2 is a block diagram of the pll module. equation 9-2 provides the relationship between input frequency (f in ) and output frequency (f osc ). equation 9-3 provides the relationship between input frequency (f in ) and vco frequency (f sys ). figure 9-2: pll block diagram equation 9-2: f osc calculation equation 9-3: f vco calculation f cy = fosc /2 n1 m n2 pfd vco pllpre<4:0> plldiv<8:0> pllpost<1:0> 0.8 mhz < f plli (1) < 8.0 mhz 120 mh z < f sys (1) < 340 mh z f osc (1) ? 120 mhz @ +125oc f in f plli f sys f osc note 1: this frequency range must be met at all times. f osc (1) ? 140 mhz @ +85oc f osc f in m n 1 n 2 ? -------------------- - ?? ?? ? f in plldiv 2 + ?? pllpre 2 + ?? 2 pllpost 1 + ?? ? --------------------------------------------------------------------------------------- - ?? ?? ? == where: n 1 = pllpre + 2 n 2 = 2 x ( pllpost + 1) m = plldiv + 2 f sys f in m n 1 ------ - ?? ?? ? f in plldiv 2 + ?? pllpre 2 + ?? ------------------------------------ - ?? ?? ? ==
? 2011-2013 microchip technology inc. ds70657g-page 153 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 9-1: configuration bit va lues for clock selection 9.2 oscillator resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 9.2.1 key resources ? section 7. ?oscillator? (ds70580) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools oscillator mode oscillator source poscmd<1:0> fnosc<2:0> see notes fast rc oscillator with divide-by-n (frcdivn) internal xx 111 1 , 2 low-power rc oscillator (lprc) internal xx 101 1 primary oscillator (hs) with pll (hspll) primary 10 011 primary oscillator (xt) with pll (xtpll) primary 01 011 primary oscillator (ec) with pll (ecpll) primary 00 011 1 primary oscillator (hs) primary 10 010 primary oscillator (xt) primary 01 010 primary oscillator (ec) primary 00 010 1 fast rc oscillator (frc) with divide-by-n and pll (frcpll) internal xx 001 1 fast rc oscillator (frc) internal xx 000 1 note 1: osc2 pin function is determined by the osciofnc configuration bit. 2: this is the default oscillator mode for an unprogrammed (erased) device. note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 154 ? 2011-2013 microchip technology inc. 9.3 oscillator control registers register 9-1: osccon: os cillator control register ( 1 ) u-0 r-0 r-0 r-0 u-0 r/w-y r/w-y r/w-y ?cosc<2:0> ?nosc<2:0> ( 2 ) bit 15 bit 8 r/w-0 r/w-0 r-0 u-0 r/w-0 u-0 u-0 r/w-0 clklock iolock lock ?cf ( 3 ) ? ? oswen bit 7 bit 0 legend: y = value set from configuration bits on por r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 cosc<2:0>: current oscillator selection bits (read-only) 111 = fast rc oscillator (frc) with divide-by-n 110 = fast rc oscillator (frc) with divide-by-16 101 = low-power rc oscillator (lprc) 100 = reserved 011 = primary oscillator (xt, hs, ec) with pll 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator (frc) with divide-by-n and pll (frcpll) 000 = fast rc oscillator (frc) bit 11 unimplemented: read as ? 0 ? bit 10-8 nosc<2:0>: new oscillator selection bits ( 2 ) 111 = fast rc oscillator (frc) with divide-by-n 110 = fast rc oscillator (frc) with divide-by-16 101 = low-power rc oscillator (lprc) 100 = reserved 011 = primary oscillator (xt, hs, ec) with pll 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator (frc) with divide-by-n and pll (frcpll) 000 = fast rc oscillator (frc) bit 7 clklock: clock lock enable bit 1 = if (fcksm0 = 1 ), then clock and pll configurations are locked; if (fcksm0 = 0 ), then clock and pll configurations may be modified 0 = clock and pll selections are not locked, configurations may be modified bit 6 iolock: i/o lock enable bit 1 = i/o lock is active 0 = i/o lock is not active bit 5 lock: pll lock status bit (read-only) 1 = indicates that pll is in lock or pll start-up timer is satisfied 0 = indicates that pll is out of lock, start-up timer is in progress or pll is disabled note 1: writes to this register require an unlock sequence. refer to section 7. ?oscillator? (ds70580) in the ?dspic33e/pic24e family reference manual? (available from the microchip web site) for details. 2: direct clock switches between any primary oscillator mode with pll and frcpll mode are not permitted. this applies to clock switches in either direction. in these instances, the application must switch to frc mode as a transitional clock source between the two pll modes. 3: this bit should only be cleared in software. setting the bit in software (= 1 ) will have the same effect as an actual oscillator failure and trigger an oscillator failure trap.
? 2011-2013 microchip technology inc. ds70657g-page 155 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 4 unimplemented: read as ? 0 ? bit 3 cf: clock fail detect bit ( 3 ) 1 = fscm has detected clock failure 0 = fscm has not detected clock failure bit 2-1 unimplemented: read as ? 0 ? bit 0 oswen: oscillator switch enable bit 1 = requests oscillator switch to selection specified by the nosc<2:0> bits 0 = oscillator switch is complete register 9-1: osccon: os cillator control register ( 1 ) (continued) note 1: writes to this register require an unlock sequence. refer to section 7. ?oscillator? (ds70580) in the ?dspic33e/pic24e family reference manual? (available from the microchip web site) for details. 2: direct clock switches between any primary oscillator mode with pll and frcpll mode are not permitted. this applies to clock switches in either direction. in these instances, the application must switch to frc mode as a transitional clock source between the two pll modes. 3: this bit should only be cleared in software. setting the bit in software (= 1 ) will have the same effect as an actual oscillator failure and trigger an oscillator failure trap.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 156 ? 2011-2013 microchip technology inc. register 9-2: clkdiv: clock divisor register r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 roi doze<2:0> ( 1 ) dozen ( 2 , 3 ) frcdiv<2:0> bit 15 bit 8 r/w-0 r/w-1 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pllpost<1:0> ? pllpre<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 roi: recover on interrupt bit 1 = interrupts will clear the dozen bit and the processor clock, and the peripheral clock ratio is set to 1:1 0 = interrupts have no effect on the dozen bit bit 14-12 doze<2:0>: processor clock reduction select bits ( 1 ) 111 = f cy divided by 128 110 = f cy divided by 64 101 = f cy divided by 32 100 = f cy divided by 16 011 = f cy divided by 8 (default) 010 = f cy divided by 4 001 = f cy divided by 2 000 = f cy divided by 1 bit 11 dozen: doze mode enable bit ( 2 , 3 ) 1 = doze<2:0> field specifies the ratio between the peripheral clocks and the processor clocks 0 = processor clock and peripheral clock ratio is forced to 1:1 bit 10-8 frcdiv<2:0>: internal fast rc oscillator postscaler bits 111 = frc divided by 256 110 = frc divided by 64 101 = frc divided by 32 100 = frc divided by 16 011 = frc divided by 8 010 = frc divided by 4 001 = frc divided by 2 000 = frc divided by 1 (default) bit 7-6 pllpost<1:0>: pll vco output divider select bits (also denoted as ?n2?, pll postscaler) 11 = output divided by 8 10 = reserved 01 = output divided by 4 (default) 00 = output divided by 2 bit 5 unimplemented: read as ? 0 ? note 1: the doze<2:0> bits can only be written to when the dozen bit is clear. if dozen = 1 , any writes to doze<2:0> are ignored. 2: this bit is cleared when the roi bit is set and an interrupt occurs. 3: the dozen bit cannot be set if doze<2:0> = 000 . if doze<2:0> = 000 , any attempt by user software to set the dozen bit is ignored.
? 2011-2013 microchip technology inc. ds70657g-page 157 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 4-0 pllpre<4:0>: pll phase detector input divider select bits (also denoted as ?n1?, pll prescaler) 11111 = input divided by 33 ? ? ? 00001 = input divided by 3 00000 = input divided by 2 (default) register 9-2: clkdiv: clock divisor register (continued) note 1: the doze<2:0> bits can only be written to when the dozen bit is clear. if dozen = 1 , any writes to doze<2:0> are ignored. 2: this bit is cleared when the roi bit is set and an interrupt occurs. 3: the dozen bit cannot be set if doze<2:0> = 000 . if doze<2:0> = 000 , any attempt by user software to set the dozen bit is ignored.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 158 ? 2011-2013 microchip technology inc. register 9-3: pllfbd: pll feedback divisor register u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 ? ? ? ? ? ? ?plldiv<8> bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 plldiv<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-9 unimplemented: read as ? 0 ? bit 8-0 plldiv<8:0>: pll feedback divisor bits (also denoted as ?m?, pll multiplier) 111111111 = 513 ? ? ? 000110000 = 50 (default) ? ? ? 000000010 = 4 000000001 = 3 000000000 = 2
? 2011-2013 microchip technology inc. ds70657g-page 159 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 9-4: osctun: frc oscillator tuning register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? tun<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as ? 0 ? bit 5-0 tun<5:0>: frc oscillator tuning bits 011111 = maximum frequency deviation of 1.453% (7.477 mhz) 011110 = center frequency + 1.406% (7.474 mhz) ? ? ? 000001 = center frequency + 0.047% (7.373 mhz) 000000 = center frequency (7.37 mhz nominal) 111111 = center frequency ? 0.047% (7.367 mhz) ? ? ? 100001 = center frequency ? 1.453% (7.263 mhz) 100000 = minimum frequency deviation of -1.5% (7.259 mhz)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 160 ? 2011-2013 microchip technology inc. register 9-5: refocon: reference oscillator control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 roon ? rosslp rosel rodiv<3:0> ( 1 ) bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 roon: reference oscillator output enable bit 1 = reference oscillator output is enabled on refclk pin ( 2 ) 0 = reference oscillator output is disabled bit 14 unimplemented: read as ? 0 ? bit 13 rosslp: reference oscillator run in sleep bit 1 = reference oscillator output continues to run in sleep 0 = reference oscillator output is disabled in sleep bit 12 rosel: reference oscillator source select bit 1 = oscillator crystal used as the reference clock 0 = system clock used as the reference clock bit 11-8 rodiv<3:0>: reference oscillator divider bits ( 1 ) 1111 = reference clock divided by 32,768 1110 = reference clock divided by 16,384 1101 = reference clock divided by 8,192 1100 = reference clock divided by 4,096 1011 = reference clock divided by 2,048 1010 = reference clock divided by 1,024 1001 = reference clock divided by 512 1000 = reference clock divided by 256 0111 = reference clock divided by 128 0110 = reference clock divided by 64 0101 = reference clock divided by 32 0100 = reference clock divided by 16 0011 = reference clock divided by 8 0010 = reference clock divided by 4 0001 = reference clock divided by 2 0000 = reference clock bit 7-0 unimplemented: read as ? 0 ? note 1: the reference oscillator output must be disabled (roon = 0 ) before writing to these bits. 2: this pin is remappable. see section 11.4 ?peripheral pin select (pps)? for more information.
? 2011-2013 microchip technology inc. ds70657g-page 161 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 10.0 power-saving features the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices provide the ability to manage power consumption by selectively managing clocking to the cpu and the peripherals. in general, a lower clock frequency and a reduction in the number of peripherals being clocked constitutes lower consumed power. dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices can manage power consumption in four ways: ? clock frequency ? instruction-based sleep and idle modes ? software-controlled doze mode ? selective peripheral control in software combinations of these methods can be used to selec- tively tailor an application?s power consumption while still maintaining critical application features, such as timing-sensitive communications. 10.1 clock frequency and clock switching the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices allow a wide range of clock frequencies to be selected under application control. if the system clock configuration is not locked, users can choose low-power or high- precision oscillators by simply changing the noscx bits (osccon<10:8>). the process of changing a system clock during operation, as well as limitations to the process, are discussed in more detail in section 9.0 ?oscillator configuration? . 10.2 instruction-based power-saving modes the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices have two special power-saving modes that are entered through the execution of a special pwrsav instruction. sleep mode stops clock operation and halts all code execution. idle mode halts the cpu and code execution, but allows peripheral modules to continue operation. the assembler syntax of the pwrsav instruction is shown in example 10-1 . sleep and idle modes can be exited as a result of an enabled interrupt, wdt time-out or a device reset. when the device exits these modes, it is said to ?wake-up?. example 10-1: pwrsav instruction syntax note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to section 9. ?watchdog timer and power-saving modes? (ds70615) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: sleep_mode and idle_mode are con- stants defined in the assembler include file for the selected device. pwrsav #sleep_mode ; put the device into sleep mode pwrsav #idle_mode ; put the device into idle mode
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 162 ? 2011-2013 microchip technology inc. 10.2.1 sleep mode the following occurs in sleep mode: ? the system clock source is shut down. if an on-chip oscillator is used, it is turned off. ? the device current consumption is reduced to a minimum, provided that no i/o pin is sourcing current. ? the fail-safe clock monitor does not operate, since the system clock source is disabled. ? the lprc clock continues to run in sleep mode if the wdt is enabled. ? the wdt, if enabled, is automatically cleared prior to entering sleep mode. ? some device features or peripherals can continue to operate. this includes items such as the input change notification (icn) on the i/o ports or peripherals that use an external clock input. ? any peripheral that requires the system clock source for its operation is disabled. the device wakes up from sleep mode on any of these events: ? any interrupt source that is individually enabled ? any form of device reset ? a wdt time-out on wake-up from sleep mode, the processor restarts with the same clock source that was active when sleep mode was entered. for optimal power savings, the internal regulator and the flash regulator can be configured to go into standby when sleep mode is entered by clearing the vregs (rcon<8>) and vr egsf (rcon<11>) bits (default configuration). if the application requires a faster wake-up time, and can accept higher current requirements, the vregs (rcon<8>) and vregsf (rcon<11>) bits can be set to keep the internal regulator and the flash regulator active during sleep mode. 10.2.2 idle mode the following occurs in idle mode: ? the cpu stops executing instructions. ? the wdt is automatically cleared. ? the system clock source remains active. by default, all peripheral modules continue to operate normally from the system clock source, but can also be selectively disabled (see section 10.4 ?peripheral module disable? ). ? if the wdt or fscm is enabled, the lprc also remains active. the device wakes from idle mode on any of these events: ? any interrupt that is individually enabled ? any device reset ? a wdt time-out on wake-up from idle mode, the clock is reapplied to the cpu and instruction execution will begin (2-4 clock cycles later), starting with the instruction following the pwrsav instruction or the first instruction in the interrupt service routine (isr). all peripherals also have the option to discontinue operation when idle mode is entered to allow for increased power savings. this option is selectable in the control register of each peripheral; for example, the tsidl bit in the timer1 control register (t1con<13>). 10.2.3 interrupts coincident with power save instructions any interrupt that coincides with the execution of a pwrsav instruction is held off until entry into sleep or idle mode has completed. the device then wakes up from sleep or idle mode.
? 2011-2013 microchip technology inc. ds70657g-page 163 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 10.3 doze mode the preferred strategies for reducing power consumption are changing clock speed and invoking one of the power- saving modes. in some circumstances, this cannot be practical. for example, it may be necessary for an application to maintain uninterrupted synchronous communication, even while it is doing nothing else. reducing system clock speed can introduce communication errors, while using a power-saving mode can stop communications completely. doze mode is a simple and effective alternative method to reduce power consumption while the device is still executing code. in this mode, the system clock continues to operate from the same source and at the same speed. peripheral modules continue to be clocked at the same speed, while the cpu clock speed is reduced. synchronization between the two clock domains is maintained, allowing the peripherals to access the sfrs while the cpu executes code at a slower rate. doze mode is enabled by setting the dozen bit (clkdiv<11>). the ratio between peripheral and core clock speed is determined by the doze<2:0> bits (clkdiv<14:12>). there are eight possible configu- rations, from 1:1 to 1:128, with 1:1 being the default setting. programs can use doze mode to selectively reduce power consumption in event-driven applications. this allows clock-sensitive functions, such as synchronous communications, to continue without interruption while the cpu idles, waiting for something to invoke an interrupt routine. an automatic return to full-speed cpu operation on interrupts can be enabled by setting the roi bit (clkdiv<15>). by default, interrupt events have no effect on doze mode operation. for example, suppose the device is operating at 20 mips and the ecan? module has been configured for 500 kbps, based on this device operating speed. if the device is placed in doze mode with a clock fre- quency ratio of 1:4, the ecan module continues to communicate at the required bit rate of 500 kbps, but the cpu now starts executing instructions at a frequency of 5 mips. 10.4 peripheral module disable the peripheral module disable (pmd) registers provide a method to disable a peripheral module by stopping all clock sources supplied to that module. when a peripheral is disabled using the appropriate pmd control bit, the peripheral is in a minimum power consumption state. the control and status registers associated with the peripheral are also disabled, so writes to those registers do not have effect and read values are invalid. a peripheral module is enabled only if both the associated bit in the pmd register is cleared and the peripheral is supported by the specific dspic ? dsc variant. if the peripheral is present in the device, it is enabled in the pmd register by default. 10.5 power-saving resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 10.5.1 key resources ? section 9. ?watchdog timer and power-saving modes? (ds70615) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: if a pmd bit is set, the corresponding module is disabled after a delay of one instruction cycle. similarly, if a pmd bit is cleared, the corresponding module is enabled after a delay of one instruction cycle (assuming the module control regis- ters are already configured to enable module operation). note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 164 ? 2011-2013 microchip technology inc. register 10-1: pmd1: peripheral mo dule disable control register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 t5md t4md t3md t2md t1md qei1md ( 1 ) pwmmd ( 1 ) ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 i2c1md u2md u1md spi2md spi1md ?c1md ( 2 ) ad1md bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 t5md: timer5 module disable bit 1 = timer5 module is disabled 0 = timer5 module is enabled bit 14 t4md: timer4 module disable bit 1 = timer4 module is disabled 0 = timer4 module is enabled bit 13 t3md: timer3 module disable bit 1 = timer3 module is disabled 0 = timer3 module is enabled bit 12 t2md: timer2 module disable bit 1 = timer2 module is disabled 0 = timer2 module is enabled bit 11 t1md: timer1 module disable bit 1 = timer1 module is disabled 0 = timer1 module is enabled bit 10 qei1md: qei1 module disable bit ( 1 ) 1 = qei1 module is disabled 0 = qei1 module is enabled bit 9 pwmmd: pwm module disable bit ( 1 ) 1 = pwm module is disabled 0 = pwm module is enabled bit 8 unimplemented: read as ? 0 ? bit 7 i2c1md: i2c1 module disable bit 1 = i2c1 module is disabled 0 = i2c1 module is enabled bit 6 u2md: uart2 module disable bit 1 = uart2 module is disabled 0 = uart2 module is enabled bit 5 u1md: uart1 module disable bit 1 = uart1 module is disabled 0 = uart1 module is enabled bit 4 spi2md: spi2 module disable bit 1 = spi2 module is disabled 0 = spi2 module is enabled note 1: this bit is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this bit is available on dspic33epxxxgp50x and dspic33epxxxmc50x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 165 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 3 spi1md: spi1 module disable bit 1 = spi1 module is disabled 0 = spi1 module is enabled bit 2 unimplemented: read as ? 0 ? bit 1 c1md: ecan1 module disable bit ( 2 ) 1 = ecan1 module is disabled 0 = ecan1 module is enabled bit 0 ad1md: adc1 module disable bit 1 = adc1 module is disabled 0 = adc1 module is enabled register 10-1: pmd1: peripheral module disable control register 1 (continued) note 1: this bit is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this bit is available on dspic33epxxxgp50x and dspic33epxxxmc50x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 166 ? 2011-2013 microchip technology inc. register 10-2: pmd2: peripheral mo dule disable control register 2 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ic4md ic3md ic2md ic1md bit 15 bit 8 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ? oc4md oc3md oc2md oc1md bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11 ic4md: input capture 4 module disable bit 1 = input capture 4 module is disabled 0 = input capture 4 module is enabled bit 10 ic3md: input capture 3 module disable bit 1 = input capture 3 module is disabled 0 = input capture 3 module is enabled bit 9 ic2md: input capture 2 module disable bit 1 = input capture 2 module is disabled 0 = input capture 2 module is enabled bit 8 ic1md: input capture 1 module disable bit 1 = input capture 1 module is disabled 0 = input capture 1 module is enabled bit 7-4 unimplemented: read as ? 0 ? bit 3 oc4md: output compare 4 module disable bit 1 = output compare 4 module is disabled 0 = output compare 4 module is enabled bit 2 oc3md: output compare 3 module disable bit 1 = output compare 3 module is disabled 0 = output compare 3 module is enabled bit 1 oc2md: output compare 2 module disable bit 1 = output compare 2 module is disabled 0 = output compare 2 module is enabled bit 0 oc1md: output compare 1 module disable bit 1 = output compare 1 module is disabled 0 = output compare 1 module is enabled
? 2011-2013 microchip technology inc. ds70657g-page 167 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 10-3: pmd3: peripheral mo dule disable control register 3 register 10-4: pmd4: peripheral mo dule disable control register 4 u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 u-0 ? ? ? ? ?cmpmd ? ? bit 15 bit 8 r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 crcmd ? ? ? ? ? i2c2md ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10 cmpmd: comparator module disable bit 1 = comparator module is disabled 0 = comparator module is enabled bit 9-8 unimplemented: read as ? 0 ? bit 7 crcmd: crc module disable bit 1 = crc module is disabled 0 = crc module is enabled bit 6-2 unimplemented: read as ? 0 ? bit 1 i2c2md: i2c2 module disable bit 1 = i2c2 module is disabled 0 = i2c2 module is enabled bit 0 unimplemented: read as ? 0 ? u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r/w-0 r/w-0 u-0 u-0 ? ? ? ?refomdctmumd ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3 refomd: reference clock module disable bit 1 = reference clock module is disabled 0 = reference clock module is enabled bit 2 ctmumd: ctmu module disable bit 1 = ctmu module is disabled 0 = ctmu module is enabled bit 1-0 unimplemented: read as ? 0 ?
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 168 ? 2011-2013 microchip technology inc. register 10-5: pmd6: peripheral mo dule disable control register 6 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ?pwm3md ( 1 ) pwm2md ( 1 ) pwm1md ( 1 ) bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10 pwm3md: pwm3 module disable bit ( 1 ) 1 = pwm3 module is disabled 0 = pwm3 module is enabled bit 9 pwm2md: pwm2 module disable bit ( 1 ) 1 = pwm2 module is disabled 0 = pwm2 module is enabled bit 8 pwm1md: pwm1 module disable bit ( 1 ) 1 = pwm1 module is disabled 0 = pwm1 module is enabled bit 7-0 unimplemented: read as ? 0 ? note 1: this bit is available on dspic33epxxxmc50x/20x and pic24epxxxmc20x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 169 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 10-6: pmd7: peripheral mo dule disable control register 7 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 u-0 u-0 u-0 ? ? ? dma0md ( 1 ) ptgmd ? ? ? dma1md ( 1 ) dma2md ( 1 ) dma3md ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 unimplemented: read as ? 0 ? bit 4 dma0md: dma0 module disable bit ( 1 ) 1 = dma0 module is disabled 0 = dma0 module is enabled dma1md: dma1 module disable bit ( 1 ) 1 = dma1 module is disabled 0 = dma1 module is enabled dma2md: dma2 module disable bit ( 1 ) 1 = dma2 module is disabled 0 = dma2 module is enabled dma3md: dma3 module disable bit ( 1 ) 1 = dma3 module is disabled 0 = dma3 module is enabled bit 3 ptgmd: ptg module disable bit 1 = ptg module is disabled 0 = ptg module is enabled bit 2-0 unimplemented: read as ? 0 ? note 1: this single bit enables and disables all four dma channels.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 170 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 171 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 11.0 i/o ports many of the device pins are shared among the peripher- als and the parallel i/o ports. all i/o input ports feature schmitt trigger inputs for improved noise immunity. 11.1 parallel i/o (pio) ports generally, a parallel i/o port that shares a pin with a peripheral is subservient to the peripheral. the peripheral?s output buffer data and control signals are provided to a pair of multiplexers. the multiplexers select whether the peripheral or the associated port has ownership of the output data and control signals of the i/o pin. the logic also prevents ?loop through,? in which a port?s digital output can drive the input of a peripheral that shares the same pin. figure 11-1 illustrates how ports are shared with other peripherals and the associated i/o pin to which they are connected. when a peripheral is enabled and the peripheral is actively driving an associated pin, the use of the pin as a general purpose output pin is disabled. the i/o pin can be read, but the output driver for the parallel port bit is disabled. if a peripheral is enabled, but the peripheral is not actively driving a pin, that pin can be driven by a port. all port pins have eight registers directly associated with their operation as digital i/o. the data direction register (trisx) determines whether the pin is an input or an out- put. if the data direction bit is a ? 1 ?, then the pin is an input. all port pins are defined as inputs after a reset. reads from the latch (latx) read the latch. writes to the latch write the latch. reads from the port (portx) read the port pins, while writes to the port pins write the latch. any bit and its associated data and control registers that are not valid for a particular device is disabled. this means the corresponding latx and trisx registers and the port pin are read as zeros. when a pin is shared with another peripheral or function that is defined as an input only, it is nevertheless regarded as a dedicated port because there is no other competing source of outputs. figure 11-1: block diagram of a typical shared port structure note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to section 10. ?i/o ports? (ds70598) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. q d ck wr lat + tris latch i/o pin wr port data bus q d ck data latch read port read tris 1 0 1 0 wr tris peripheral output data output enable peripheral input data i/o peripheral module peripheral output enable pio module output multiplexers output data input data peripheral module enable read lat
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 172 ? 2011-2013 microchip technology inc. 11.1.1 open-drain configuration in addition to the port, lat and tris registers for data control, port pins can also be individually configured for either digital or open-drain output. this is controlled by the open-drain control register, odcx, associated with each port. setting any of the bits configures the corresponding pin to act as an open-drain output. the open-drain feature allows the generation of outputs other than v dd by using external pull-up resistors. the maximum open-drain voltage allowed on any pin is the same as the maximum v ih specification for that particular pin. see the ?pin diagrams? section for the available 5v tolerant pins and tab le 3 0- 11 for the maximum v ih specification for each pin. 11.2 configuring analog and digital port pins the anselx register controls the operation of the analog port pins. the port pins that are to function as analog inputs or outputs must have their corresponding ansel and tris bits set. in order to use port pins for i/o functionality with digital modules, such as timers, uarts, etc., the corresponding anselx bit must be cleared. the anselx register has a default value of 0xffff; therefore, all pins that share analog functions are analog (not digital) by default. pins with analog functions affected by the anselx registers are listed with a buffer type of analog in the pinout i/o descriptions (see table 1-1 ). if the tris bit is cleared (output) while the anselx bit is set, the digital output level (v oh or v ol ) is converted by an analog peripheral, such as the adc module or comparator module. when the port register is read, all pins configured as analog input channels are read as cleared (a low level). pins configured as digital inputs do not convert an analog input. analog levels on any pin defined as a digital input (including the anx pins) can cause the input buffer to consume current that exceeds the device specifications. 11.2.1 i/o port write/read timing one instruction cycle is required between a port direction change or port write operation and a read operation of the same port. typically this instruction would be a nop , as shown in example 11-1 . 11.3 input change notification (icn) the input change notification function of the i/o ports allows devices to generate interrupt requests to the processor in response to a change-of-state (cos) on selected input pins. this feature can detect input change-of-states even in sleep mode, when the clocks are disabled. every i/o port pin can be selected (enabled) for generating an interrupt request on a change-of-state. three control registers are associated with the cn functionality of each i/o port. the cnenx registers contain the cn interrupt enable control bits for each of the input pins. setting any of these bits enables a cn interrupt for the corresponding pins. each i/o pin also has a weak pull-up and a weak pull-down connected to it. the pull-ups and pull- downs act as a current source or sink source connected to the pin and eliminate the need for external resistors when push-button, or keypad devices are connected. the pull-ups and pull-downs are enabled separately, using the cnpux and the cnpdx registers, which contain the control bits for each of the pins. setting any of the control bits enables the weak pull-ups and/or pull-downs for the corresponding pins. example 11-1: port write/read example note: pull-ups and pull-downs on change notifi- cation pins should always be disabled when the port pin is configured as a digital output. mov 0xff00, w0 ; configure portb<15:8> ; as inputs mov w0, trisb ; and portb<7:0> ; as outputs nop ; delay 1 cycle btss portb, #13 ; next instruction
? 2011-2013 microchip technology inc. ds70657g-page 173 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 11.4 peripheral pin select (pps) a major challenge in general purpose devices is provid- ing the largest possible set of peripheral features while minimizing the conflict of features on i/o pins. the challenge is even greater on low pin count devices. in an application where more than one peripheral needs to be assigned to a single pin, inconvenient work- arounds in application code, or a complete redesign, may be the only option. peripheral pin select configuration provides an alternative to these choices by enabling peripheral set selection and their placement on a wide range of i/o pins. by increasing the pinout options available on a particular device, users can better tailor the device to their entire application, rather than trimming the application to fit the device. the peripheral pin select configuration feature oper- ates over a fixed subset of digital i/o pins. users may independently map the input and/or output of most dig- ital peripherals to any one of these i/o pins. hardware safeguards are included that prevent accidental or spurious changes to the peripheral mapping once it has been established. 11.4.1 available pins the number of available pins is dependent on the particular device and its pin count. pins that support the peripheral pin select feature include the label, ?rpn? or ?rpin?, in their full pin designation, where ?n? is the remappable pin number. ?rp? is used to designate pins that support both remappable input and output functions, while ?rpi? indicates pins that support remappable input functions only. 11.4.2 available peripherals the peripherals managed by the peripheral pin select are all digital-only peripherals. these include general serial communications (uart and spi), general pur- pose timer clock inputs, timer-related peripherals (input capture and output compare) and interrupt-on-change inputs. in comparison, some digital-only peripheral modules are never included in the peripheral pin select feature. this is because the peripheral?s function requires special i/o circuitry on a specific port and cannot be easily connected to multiple pins. these modules include i 2 c? and the pwm. a similar requirement excludes all modules with analog inputs, such as the adc converter. a key difference between remappable and non- remappable peripherals is that remappable peripherals are not associated with a default i/o pin. the peripheral must always be assigned to a specific i/o pin before it can be used. in contrast, non-remappable peripherals are always available on a default pin, assuming that the peripheral is active and not conflicting with another peripheral. when a remappable peripheral is active on a given i/o pin, it takes priority over all other digital i/o and digital communication peripherals associated with the pin. priority is given regardless of the type of peripheral that is mapped. remappable peripherals never take priority over any analog functions associated with the pin. 11.4.3 controlling peripheral pin select peripheral pin select features are controlled through two sets of sfrs: one to map peripheral inputs and one to map outputs. because they are separately con- trolled, a particular peripheral?s input and output (if the peripheral has both) can be placed on any selectable function pin without constraint. the association of a peripheral to a peripheral- selectable pin is handled in two different ways, depending on whether an input or output is being mapped.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 174 ? 2011-2013 microchip technology inc. 11.4.4 input mapping the inputs of the peripheral pin select options are mapped on the basis of the peripheral. that is, a control register associated with a peripheral dictates the pin it will be mapped to. the rpinrx registers are used to configure peripheral input mapping (see register 11-1 through register 11-17 ). each register contains sets of 7-bit fields, with each set associated with one of the remappable peripherals. programming a given periph- eral?s bit field with an appropriate 7-bit value maps the rpn pin with the corresponding value to that peripheral. for any given device, the valid range of values for any bit field corresponds to the maximum number of peripheral pin selections supported by the device. for example, figure 11-2 illustrates remappable pin selection for the u1rx input. figure 11-2: remappable input for u1rx 11.4.4.1 virtual connections dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices support virtual (internal) connections to the output of the op amp/ comparator module (see figure 25-1 in section 25.0 ?op amp/comparator module? ), and the ptg module (see section 24.0 ?peripheral trigger generator (ptg) module? ). in addition, dspic33epxxxmc20x/50x and pic24epxxxmc20x devices support virtual connec- tions to the filtered qei module inputs: findx1, fhome1, findx2 and fhome2 (see figure 17-1 in section 17.0 ?quadrature encoder interface (qei) module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? . virtual connections provide a simple way of inter- peripheral connection without utilizing a physical pin. for example, by setting the flt1r<6:0> bits of the rpinr12 register to the value of ?b0000001 , the output of the analog comparator, c1out, will be connected to the pwm fault 1 input, which allows the analog comparator to trigger pwm faults without the use of an actual physical pin on the device. virtual connection to the qei module allows peripherals to be connected to the qei digital filter input. to utilize this filter, the qei module must be enabled and its inputs must be connected to a physical rpn pin. example 11-2 illustrates how the input capture module can be connected to the qei digital filter. example 11-2: connecting ic1 to the home1 qei1 digital filter input on pin 43 of the dspic33epxxxmc206 device rp0 rp1 rp3 0 1 2 u1rx input u1rxr<6:0> to peripheral rpn n note: for input only, peripheral pin select func- tionality does not have priority over trisx settings. therefore, when configuring an rpn pin for input, the corresponding bit in the trisx register must also be configured for input (set to ? 1 ?). rpinr15 = 0x2500; /* connect the qei1 home1 input to rp37 (pin 43) */ rpinr7 = 0x009; /* connect the ic1 input to the digital filter on the fhome1 input */ qei1ioc = 0x4000; /* enable the qei digital filter */ qei1con = 0x8000; /* enable the qei module */
? 2011-2013 microchip technology inc. ds70657g-page 175 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 11-1: selectable input sources (maps input to function) input name ( 1 ) function name register configuration bits external interrupt 1 int1 rpinr0 int1r<6:0> external interrupt 2 int2 rpinr1 int2r<6:0> timer2 external clock t2ck rpinr3 t2ckr<6:0> input capture 1 ic1 rpinr7 ic1r<6:0> input capture 2 ic2 rpinr7 ic2r<6:0> input capture 3 ic3 rpinr8 ic3r<6:0> input capture 4 ic4 rpinr8 ic4r<6:0> output compare fault a ocfa rpinr11 ocfar<6:0> pwm fault 1 ( 3 ) flt1 rpinr12 flt1r<6:0> pwm fault 2 ( 3 ) flt2 rpinr12 flt2r<6:0> qei1 phase a ( 3 ) qea1 rpinr14 qea1r<6:0> qei1 phase b ( 3 ) qeb1 rpinr14 qeb1r<6:0> qei1 index ( 3 ) indx1 rpinr15 indx1r<6:0> qei1 home ( 3 ) home1 rpinr15 hom1r<6:0> uart1 receive u1rx rpinr18 u1rxr<6:0> uart2 receive u2rx rpinr19 u2rxr<6:0> spi2 data input sdi2 rpinr22 sdi2r<6:0> spi2 clock input sck2 rpinr22 sck2r<6:0> spi2 slave select ss2 rpinr23 ss2r<6:0> can1 receive ( 2 ) c1rx rpinr26 c1rxr<6:0> pwm synch input 1 ( 3 ) synci1 rpinr37 synci1r<6:0> pwm dead-time compensation 1 ( 3 ) dtcmp1 rpinr38 dtcmp1r<6:0> pwm dead-time compensation 2 ( 3 ) dtcmp2 rpinr39 dtcmp2r<6:0> pwm dead-time compensation 3 ( 3 ) dtcmp3 rpinr39 dtcmp3r<6:0> note 1: unless otherwise noted, all inputs use the schmitt trigger input buffers. 2: this input source is available on dspic33epxxxgp/mc50x devices only. 3: this input source is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 176 ? 2011-2013 microchip technology inc. table 11-2: input pin selection for selectable input sources peripheral pin select input register value input/ output pin assignment peripheral pin select input register value input/ output pin assignment 000 0000 iv ss 010 1101 irpi45 000 0001 ic1out ( 1 ) 010 1110 irpi46 000 0010 ic2out ( 1 ) 010 1111 irpi47 000 0011 ic3out ( 1 ) 011 0000 ? ? 000 0100 ic4out ( 1 ) 011 0001 ? ? 000 0101 ? ? 011 0010 ? ? 000 0110 iptgo30 ( 1 ) 011 0011 irpi51 000 0111 iptgo31 ( 1 ) 011 0100 irpi52 000 1000 i findx1 ( 1 , 2 ) 011 0101 irpi53 000 1001 ifhome1 ( 1 , 2 ) 011 0110 i/o rp54 000 1010 ? ? 011 0111 i/o rp55 000 1011 ? ? 011 1000 i/o rp56 000 1100 ? ? 011 1001 i/o rp57 000 1101 ? ? 011 1010 irpi58 000 1110 ? ? 011 1011 ? ? 000 1111 ? ? 011 1100 ? ? 001 0000 ? ? 011 1101 ? ? 001 0001 ? ? 011 1110 ? ? 001 0010 ? ? 011 1111 ? ? 001 0011 ? ? 100 0000 ? ? 001 0100 i/o rp20 100 0001 ? ? 001 0101 ? ? 100 0010 ? ? 001 0110 ? ? 100 0011 ? ? 001 0111 ? ? 100 0100 ? ? 001 1000 irpi24 100 0101 ? ? 001 1001 irpi25 100 0110 ? ? 001 1010 ? ? 100 0111 ? ? 001 1011 irpi27 100 1000 ? ? 001 1100 irpi28 100 1001 ? ? 001 1101 ? ? 100 1010 ? ? 001 1110 ? ? 100 1011 ? ? 001 1111 ? ? 100 1100 ? ? 010 0000 irpi32 100 1101 ? ? 010 0001 irpi33 100 1110 ? ? 010 0010 irpi34 100 1111 ? ? 010 0011 i/o rp35 101 0000 ? ? 010 0100 i/o rp36 101 0001 ? ? 010 0101 i/o rp37 101 0010 ? ? 010 0110 i/o rp38 101 0011 ? ? 010 0111 i/o rp39 101 0100 ? ? legend: shaded rows indicate pps input register values that are unimplemented. note 1: see section 11.4.4.1 ?virtual connections? for more information on selecting this pin assignment. 2: these inputs are available on dspic33epxxxgp/mc50x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 177 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 010 1000 i/o rp40 101 0101 ? ? 010 1001 i/o rp41 101 0110 ? ? 010 1010 i/o rp42 101 0111 ? ? 010 1011 i/o rp43 101 1000 ? ? 010 1100 irpi44 101 1001 ? ? 101 1010 ? ? 110 1101 ? ? 101 1011 ? ? 110 1110 ? ? 101 1100 ? ? 110 1111 ? ? 101 1101 ? ? 111 0000 ? ? 101 1110 irpi94 111 0001 ? ? 101 1111 irpi95 111 0010 ? ? 110 0000 irpi96 111 0011 ? ? 110 0001 i/o rp97 111 0100 ? ? 110 0010 ? ? 111 0101 ? ? 110 0011 ? ? 111 0110 i/o rp118 110 0100 ? ? 111 0111 irpi119 110 0101 ? ? 111 1000 i/o rp120 110 0110 ? ? 111 1001 irpi121 110 0111 ? ? 111 1010 ? ? 110 1000 ? ? 111 1011 ? ? 110 1001 ? ? 111 1100 ? ? 110 1010 ? ? 111 1101 ? ? 110 1011 ? ? 111 1110 ? ? 110 1100 ? ? 111 1111 ? ? table 11-2: input pin selection for selectable input sources (continued) peripheral pin select input register value input/ output pin assignment peripheral pin select input register value input/ output pin assignment legend: shaded rows indicate pps input register values that are unimplemented. note 1: see section 11.4.4.1 ?virtual connections? for more information on selecting this pin assignment. 2: these inputs are available on dspic33epxxxgp/mc50x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 178 ? 2011-2013 microchip technology inc. 11.4.4.2 output mapping in contrast to inputs, the outputs of the peripheral pin select options are mapped on the basis of the pin. in this case, a control register associated with a particular pin dictates the peripheral output to be mapped. the rporx registers are used to control output mapping. like the rpinrx registers, each register contains sets of 6-bit fields, with each set associated with one rpn pin (see register 11-18 through register 11-27 ). the value of the bit field corresponds to one of the periph- erals and that peripheral?s output is mapped to the pin (see table 11-3 and figure 11-3 ). a null output is associated with the output register reset value of ? 0 ?. this is done to ensure that remap- pable outputs remain disconnected from all output pins by default. figure 11-3: multiplexing remappable output for rpn 11.4.4.3 mapping limitations the control schema of the peripheral select pins is not lim- ited to a small range of fixed peripheral configurations. there are no mutual or hardware-enforced lockouts between any of the peripheral mapping sfrs. literally any combination of peripheral mappings across any or all of the rpn pins is possible. this includes both many-to- one and one-to-many mappings of peripheral inputs and outputs to pins. while such mappings may be technically possible from a configuration point of view, they may not be supportable from an electrical point of view. rpnr<5:0> 0 49 1 default u1tx output sdo2 output 2 refclko output 48 qei1ccmp output output data rpn table 11-3: output selection for remappable pins (rpn) function rpnr<5:0> output name default port 000000 rpn tied to default pin u1tx 000001 rpn tied to uart1 transmit u2tx 000011 rpn tied to uart2 transmit sdo2 001000 rpn tied to spi2 data output sck2 001001 rpn tied to spi2 clock output ss2 001010 rpn tied to spi2 slave select c1tx ( 2 ) 001110 rpn tied to can1 transmit oc1 010000 rpn tied to output compare 1 output oc2 010001 rpn tied to output compare 2 output oc3 010010 rpn tied to output compare 3 output oc4 010011 rpn tied to output compare 4 output c1out 011000 rpn tied to comparator output 1 c2out 011001 rpn tied to comparator output 2 c3out 011010 rpn tied to comparator output 3 synco1 ( 1 ) 101101 rpn tied to pwm primary time base sync output qei1ccmp ( 1 ) 101111 rpn tied to qei 1 counter comparator output refclko 110001 rpn tied to reference clock output c4out 110010 rpn tied to comparator output 4 note 1: this function is available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this function is available in dspic33epxxxgp/mc50x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 179 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 11.5 i/o helpful tips 1. in some cases, certain pins, as defined in table 30-11 , under ?injection current?, have inter- nal protection diodes to v dd and v ss . the term, ?injection current?, is also referred to as ?clamp current?. on designated pins, with sufficient exter- nal current-limiting precautions by the user, i/o pin input voltages are allowed to be greater or less than the data sheet absolute maximum ratings, with respect to the v ss and v dd supplies. note that when the user application forward biases either of the high or low side internal input clamp diodes, that the resulting current being injected into the device, that is clamped internally by the v dd and v ss power rails, may affect the adc accuracy by four to six counts. 2. i/o pins that are shared with any analog input pin (i.e., anx) are always analog pins by default after any reset. consequently, configuring a pin as an analog input pin automatically disables the digital input pin buffer and any attempt to read the digital input level by reading portx or latx will always return a ? 0 ?, regardless of the digital logic level on the pin. to use a pin as a digital i/o pin on a shared anx pin, the user application needs to configure the analog pin configuration registers in the i/o ports module (i.e., anselx) by setting the appropriate bit that corresponds to that i/o port pin to a ? 0 ?. 3. most i/o pins have multiple functions. referring to the device pin diagrams in this data sheet, the prior- ities of the functions allocated to any pins are indicated by reading the pin name from left-to-right. the left most function name takes precedence over any function to its right in the naming convention. for example: an16/t2ck/t7ck/rc1. this indi- cates that an16 is the highest priority in this example and will supersede all other functions to its right in the list. those other functions to its right, even if enabled, would not work as long as any other function to its left was enabled. this rule applies to all of the functions listed for a given pin. 4. each pin has an internal weak pull-up resistor and pull-down resistor that can be configured using the cnpux and cnpdx registers, respectively. these resistors eliminate the need for external resistors in certain applications. the internal pull-up is up to ~(v dd ? 0.8), not v dd . this value is still above the minimum v ih of cmos and ttl devices. 5. when driving leds directly, the i/o pin can source or sink more current than what is specified in the v oh /i oh and v ol /i ol dc characteristic specifica- tion. the respective i oh and i ol current rating only applies to maintaining the corresponding output at or above the v oh , and at or below the v ol levels. however, for leds, unlike digital inputs of an externally connected device, they are not gov- erned by the same minimum v ih /v il levels. an i/o pin output can safely sink or source any current less than that listed in the absolute maximum rating section of this data sheet. for example: v oh = 2.4v @ i oh = -8 ma and v dd = 3.3v the maximum output current sourced by any 8 ma i/o pin = 12 ma. led source current < 12 ma is technically permitted. refer to the v oh /i oh graphs in section 30.0 ?electrical characteristics? for additional information. 6. the peripheral pin select (pps) pin mapping rules are as follows: a) only one ?output? function can be active on a given pin at any time, regardless if it is a dedicated or remappable function (one pin, one output). b) it is possible to assign a ?remappable output? function to multiple pins and externally short or tie them together for increased current drive. c) if any ?dedicated output? function is enabled on a pin, it will take precedence over any remappable ?output? function. d) if any ?dedicated digital? (input or output) func- tion is enabled on a pin, any number of ?input? remappable functions can be mapped to the same pin. e) if any ?dedicated analog? function(s) are enabled on a given pin, ?digital input(s)? of any kind will all be disabled, although a single ?dig- ital output?, at the user?s cautionary discretion, can be enabled and active as long as there is no signal contention with an external analog input signal. for example, it is possible for the adc to convert the digital output logic level, or to toggle a digital output on a comparator or adc input provided there is no external analog input, such as for a built-in self-test. f) any number of ?input? remappable functions can be mapped to the same pin(s) at the same time, including to any pin with a single output from either a dedicated or remappable ?output?. note: although it is not possible to use a digital input pin when its analog function is enabled, it is possible to use the digital i/o output function, trisx = 0x0, while the analog function is also enabled. however, this is not recommended, particularly if the analog input is connected to an external analog voltage source, which would create signal contention between the analog signal and the output pin driver.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 180 ? 2011-2013 microchip technology inc. g) the tris registers control only the digital i/o output buffer. any other dedicated or remappa- ble active ?output? will automatically override the tris setting. the tris register does not control the digital logic ?input? buffer. remap- pable digital ?inputs? do not automatically override tris settings, which means that the tris bit must be set to input for pins with only remappable input function(s) assigned h) all analog pins are enabled by default after any reset and the corresponding digital input buffer on the pin has been disabled. only the analog pin select registers control the digital input buffer, not the tris register. the user must disable the analog function on a pin using the analog pin select registers in order to use any ?digital input(s)? on a corresponding pin, no exceptions. 11.6 i/o ports resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 11.6.1 key resources ? section 2. ?i/o ports? (ds70598) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 181 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 11.7 peripheral pin select registers register 11-1: rpinr0: peripheral pin select input register 0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?int1r<6:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 int1r<6:0>: assign external interrupt 1 (int1) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7-0 unimplemented: read as ? 0 ?
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 182 ? 2011-2013 microchip technology inc. register 11-2: rpinr1: peripheral pin select input register 1 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?int2r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 int2r<6:0>: assign external interrupt 2 (int2) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss register 11-3: rpinr3: peripheral pin select input register 3 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?t2ckr<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 t2ckr<6:0>: assign timer2 external clock (t2ck) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011-2013 microchip technology inc. ds70657g-page 183 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-4: rpinr7: peripheral pin select input register 7 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ic2r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ic1r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 ic2r<6:0>: assign input capture 2 (ic2) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 ic1r<6:0>: assign input capture 1 (ic1) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 184 ? 2011-2013 microchip technology inc. register 11-5: rpinr8: peripheral pin select input register 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ic4r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ic3r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 ic4r<6:0>: assign input capture 4 (ic4) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 ic3r<6:0>: assign input capture 3 (ic3) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011-2013 microchip technology inc. ds70657g-page 185 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-6: rpinr11: peripheral pin select input register 11 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?ocfar<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 ocfar<6:0>: assign output compare fault a (ocfa) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 186 ? 2011-2013 microchip technology inc. register 11-7: rpinr12: peripheral pin select input register 12 (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?flt2r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?flt1r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 flt2r<6:0>: assign pwm fault 2 (flt2) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 flt1r<6:0>: assign pwm fault 1 (flt1) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011-2013 microchip technology inc. ds70657g-page 187 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-8: rpinr14: peripheral pin select input register 14 (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? qeb1r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? qea1r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 qeb1r<6:0>: assign b (qeb) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 qea1r<6:0>: assign a (qea) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 188 ? 2011-2013 microchip technology inc. register 11-9: rpinr15: peripheral pin select input register 15 (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? home1r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? indx1r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 home1r<6:0>: assign qei1 home1 (home1) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 ind1xr<6:0>: assign qei1 index1 (indx1) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011-2013 microchip technology inc. ds70657g-page 189 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-10: rpinr18: peripheral pin select input register 18 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?u1rxr<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 u1rxr<6:0>: assign uart1 receive (u1rx) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss register 11-11: rpinr19: peripheral pin select input register 19 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?u2rxr<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 u2rxr<6:0>: assign uart2 receive (u2rx) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 190 ? 2011-2013 microchip technology inc. register 11-12: rpinr22: peripheral pin select input register 22 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? sck2inr<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?sdi2r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 sck2inr <6:0>: assign spi2 clock input (sck2) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 sdi2r <6:0>: assign spi2 data input (sdi2) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011-2013 microchip technology inc. ds70657g-page 191 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-13: rpinr23: peripheral pin select input register 23 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ss2r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 6-0 ss2r <6:0>: assign spi2 slave select (ss2 ) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss register 11-14: rpinr26: peripheral pin select input register 26 (dspic33epxxxgp/mc50x devices only) u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?c1rxr<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 c1rxr<6:0>: assign can1 rx input (crx1) to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 192 ? 2011-2013 microchip technology inc. register 11-15: rpinr37: peripheral pin select input register 37 (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? synci1r<6:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 synci1r<6:0>: assign pwm synchronization input 1 to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7-0 unimplemented: read as ? 0 ?
? 2011-2013 microchip technology inc. ds70657g-page 193 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-16: rpinr38: peripheral pin select input register 38 (dspic33epxxxmc02x and pic24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?dtcmp1r<6:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 dtcmp1r<6:0>: assign pwm dead-time compensation input 1 to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7-0 unimplemented: read as ? 0 ?
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 194 ? 2011-2013 microchip technology inc. register 11-17: rpinr39: peripheral pin select input register 39 (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?dtcmp3r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?dtcmp2r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 dtcmp3r<6:0>: assign pwm dead-time compensation input 3 to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 dtcmp2r<6:0>: assign pwm dead-time compensation input 2 to the corresponding rpn pin bits (see table 11-2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011-2013 microchip technology inc. ds70657g-page 195 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-18: rpor0: peripheral pin select output register 0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp35r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp20r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp35r<5:0>: peripheral output function is assigned to rp35 output pin bits (see table 11-3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp20r<5:0>: peripheral output function is assigned to rp20 output pin bits (see table 11-3 for peripheral function numbers) register 11-19: rpor1: peripheral pin select output register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp37r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp36r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp37r<5:0>: peripheral output function is assigned to rp37 output pin bits (see table 11-3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp36r<5:0>: peripheral output function is assigned to rp36 output pin bits (see table 11-3 for peripheral function numbers)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 196 ? 2011-2013 microchip technology inc. register 11-20: rpor2: peripheral pin select output register 2 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp39r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp38r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp39r<5:0>: peripheral output function is assigned to rp39 output pin bits (see table 11-3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp38r<5:0>: peripheral output function is assigned to rp38 output pin bits (see table 11-3 for peripheral function numbers) register 11-21: rpor3: peripheral pin select output register 3 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp41r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp40r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp41r<5:0>: peripheral output function is assigned to rp41 output pin bits (see table 11-3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp40r<5:0>: peripheral output function is assigned to rp40 output pin bits (see table 11-3 for peripheral function numbers)
? 2011-2013 microchip technology inc. ds70657g-page 197 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-22: rpor4: peripheral pin select output register 4 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp43r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp42r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp43r<5:0>: peripheral output function is assigned to rp43 output pin bits (see table 11-3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp42r<5:0>: peripheral output function is assigned to rp42 output pin bits (see table 11-3 for peripheral function numbers) register 11-23: rpor5: peripheral pin select output register 5 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp55r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp54r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp55r<5:0>: peripheral output function is assigned to rp55 output pin bits (see table 11-3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp54r<5:0>: peripheral output function is assigned to rp54 output pin bits (see table 11-3 for peripheral function numbers)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 198 ? 2011-2013 microchip technology inc. register 11-24: rpor6: peripheral pin select output register 6 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp57r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp56r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp57r<5:0>: peripheral output function is assigned to rp57 output pin bits (see table 11-3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp56r<5:0>: peripheral output function is assigned to rp56 output pin bits (see table 11-3 for peripheral function numbers) register 11-25: rpor7: peripheral pin select output register 7 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?rp97r<5:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp97r<5:0>: peripheral output function is assigned to rp97 output pin bits (see table 11-3 for peripheral function numbers) bit 7-0 unimplemented: read as ? 0 ?
? 2011-2013 microchip technology inc. ds70657g-page 199 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 11-26: rpor8: peripheral pin select output register 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp118r<5:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp118r<5:0>: peripheral output function is assigned to rp118 output pin bits (see table 11-3 for peripheral function numbers) bit 7-0 unimplemented: read as ? 0 ? register 11-27: rpor9: peripheral pin select output register 9 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp120r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as ? 0 ? bit 5-0 rp120r<5:0>: peripheral output function is assigned to rp120 output pin bits (see table 11-3 for peripheral function numbers)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 200 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 201 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 12.0 timer1 the timer1 module is a 16-bit timer that can operate as a free-running interval timer/counter. the timer1 module has the following unique features over other timers: ? can be operated in asynchronous counter mode from an external clock source ? the external clock input (t1ck) can optionally be synchronized to the internal device clock and the clock synchronization is performed after the prescaler a block diagram of timer1 is shown in figure 12-1 . the timer1 module can operate in one of the following modes: ? timer mode ? gated timer mode ? synchronous counter mode ? asynchronous counter mode in timer and gated timer modes, the input clock is derived from the internal instruction cycle clock (f cy ). in synchronous and asynchronous counter modes, the input clock is derived from the external clock input at the t1ck pin. the timer modes are determined by the following bits: ? timer clock source control bit (tcs): t1con<1> ? timer synchronization control bit (tsync): t1con<2> ? timer gate control bit (tgate): t1con<6> timer control bit setting for different operating modes are given in the table 12-1 . table 12-1: timer mode settings figure 12-1: 16-bit time r1 module block diagram note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 11. ?timers? (ds70362) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. mode tcs tgate tsync timer 00x gated timer 01x synchronous counter 1x1 asynchronous counter 1x0 tgate tcs 00 10 x1 pr1 tgate set t1if flag 0 1 tsync 1 0 sync equal reset t1ck prescaler (/n) tckps<1:0> gate sync f p (1) falling edge detect tckps<1:0> note 1: f p is the peripheral clock. latch data clk t1clk ctmu edge control logic tmr1 comparator prescaler (/n)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 202 ? 2011-2013 microchip technology inc. 12.1 timer1 resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 12.1.1 key resources ? section 11. ?timers? (ds70362) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 203 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 12.2 timer1 control register register 12-1: t1con: ti mer1 control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton ( 1 ) ?tsidl ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 u-0 ? tgate tckps<1:0> ? tsync ( 1 ) tcs ( 1 ) ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timer1 on bit ( 1 ) 1 = starts 16-bit timer1 0 = stops 16-bit timer1 bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: timer1 stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timer1 gated time accumulation enable bit when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation is enabled 0 = gated time accumulation is disabled bit 5-4 tckps<1:0>: timer1 input clock prescale select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3 unimplemented: read as ? 0 ? bit 2 tsync: timer1 external clock input synchronization select bit ( 1 ) when tcs = 1 : 1 = synchronizes external clock input 0 = does not synchronize external clock input when tcs = 0 : this bit is ignored. bit 1 tcs: timer1 clock source select bit ( 1 ) 1 = external clock is from pin, t1ck (on the rising edge) 0 = internal clock (f p ) bit 0 unimplemented: read as ? 0 ? note 1: when timer1 is enabled in external synchronous counter mode (tcs = 1 , tsync = 1 , ton = 1 ), any attempts by user software to write to the tmr1 register are ignored.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 204 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 205 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 13.0 timer2/3 and timer4/5 the timer2/3 and timer4/5 modules are 32-bit timers, which can also be configured as four independent 16-bit timers with selectable operating modes. as 32-bit timers, timer2/3 and timer4/5 operate in three modes: ? two independent 16-bit timers (e.g., timer2 and timer3) with all 16-bit operating modes (except asynchronous counter mode) ? single 32-bit timer ? single 32-bit synchronous counter they also support these features: ? timer gate operation ? selectable prescaler settings ? timer operation during idle and sleep modes ? interrupt on a 32-bit period register match ? time base for input capture and output compare modules (timer2 and timer3 only) ? adc1 event trigger (32-bit timer pairs, and timer3 and timer5 only) individually, all four of the 16-bit timers can function as synchronous timers or counters. they also offer the features listed previously, except for the event trigger; this is implemented only with timer2/3. the operating modes and enabled features are determined by setting the appropriate bit(s) in the t2con, t3con, and t4con, t5con registers. t2con and t4con are shown in generic form in register 13-1 . t3con and t5con are shown in register 13-2 . for 32-bit timer/counter operation, timer2 and timer4 are the least significant word (lsw); timer3 and timer5 are the most significant word (msw) of the 32-bit timers. a block diagram for an example 32-bit timer pair (timer2/3 and timer4/5) is shown in figure 13-3 . note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 11. ?timers? (ds70362) of the ?dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: for 32-bit operation, t3con and t5con control bits are ignored. only t2con and t4con control bits are used for setup and control. timer2 and timer4 clock and gate inputs are utilized for the 32-bit timer modules, but an interrupt is generated with the timer3 and timer5 interrupt flags. note: only timer2, 3, 4 and 5 can trigger a dma data transfer.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 206 ? 2011-2013 microchip technology inc. figure 13-1: type b timer block diagram (x = 2 and 4) figure 13-2: type c timer block diagram (x = 3 and 5) note 1: f p is the peripheral clock. tgate tcs 00 10 x1 prx tgate set txif flag 0 1 equal reset txck tckps<1:0> gate sync f p (1) falling edge detect tckps<1:0> latch data clk txclk tmrx comparator prescaler (/n) prescaler (/n) sync note 1: f p is the peripheral clock. 2: the adc trigger is available on tmr3 and tmr5 only. tgate tcs 00 10 x1 prx tgate set txif flag 0 1 equal reset txck tckps<1:0> gate sync f p (1) falling edge detect tckps<1:0> latch data clk txclk tmrx comparator prescaler (/n) prescaler (/n) sync adc start of conversion trigger (2)
? 2011-2013 microchip technology inc. ds70657g-page 207 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 13-3: type b/type c timer pair block diagram (32-bit timer) 13.1 timerx resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 13.1.1 key resources ? section 11. ?timers? (ds70362) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools tgate tcs 00 10 x1 comparator tgate set tyif flag 0 1 equal reset txck tckps<1:0> f p (1) tckps<1:0> note 1: the adc trigger is available on the tmr3:tmr2 andtmr5:tmr4 32-bit timer pairs. 2: timerx is a type b timer (x = 2 and 4). 3: timery is a type c timer (x = 3 and 5). latch data clk adc prx tmryhld data bus<15:0> msw lsw prescaler (/n) prescaler (/n) sync gate sync falling edge detect pry tmrx tmry note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 208 ? 2011-2013 microchip technology inc. 13.2 timer control registers register 13-1: txcon: (timer2 and timer4) control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton ?tsidl ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 u-0 ? tgate tckps<1:0> t32 ?tcs ( 1 ) ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timerx on bit when t32 = 1 : 1 = starts 32-bit timerx/y 0 = stops 32-bit timerx/y when t32 = 0 : 1 = starts 16-bit timerx 0 = stops 16-bit timerx bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: timerx stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timerx gated time accumulation enable bit when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation is enabled 0 = gated time accumulation is disabled bit 5-4 tckps<1:0>: timerx input clock prescale select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3 t32: 32-bit timer mode select bit 1 = timerx and timery form a single 32-bit timer 0 = timerx and timery act as two 16-bit timers bit 2 unimplemented: read as ? 0 ? bit 1 tcs: timerx clock source select bit ( 1 ) 1 = external clock is from pin, txck (on the rising edge) 0 = internal clock (f p ) bit 0 unimplemented: read as ? 0 ? note 1: the txck pin is not available on all timers. refer to the ? pin diagrams ? section for the available pins.
? 2011-2013 microchip technology inc. ds70657g-page 209 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 13-2: tycon: (timer3 and timer5) control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton ( 1 ) ?tsidl ( 2 ) ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 ?tgate ( 1 ) tckps<1:0> ( 1 ) ? ?tcs ( 1 , 3 ) ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timery on bit ( 1 ) 1 = starts 16-bit timery 0 = stops 16-bit timery bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: timery stop in idle mode bit ( 2 ) 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timery gated time accumulation enable bit ( 1 ) when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation is enabled 0 = gated time accumulation is disabled bit 5-4 tckps<1:0>: timery input clock prescale select bits ( 1 ) 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3-2 unimplemented: read as ? 0 ? bit 1 tcs: timery clock source select bit ( 1 , 3 ) 1 = external clock is from pin, tyck (on the rising edge) 0 = internal clock (f p ) bit 0 unimplemented: read as ? 0 ? note 1: when 32-bit operation is enabled (t2con<3> = 1 ), these bits have no effect on timery operation; all timer functions are set through txcon. 2: when 32-bit timer operation is enabled (t32 = 1 ) in the timerx control register (txcon<3>), the tsidl bit must be cleared to operate the 32-bit timer in idle mode. 3: the tyck pin is not available on all timers. see the ? pin diagrams ? section for the available pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 210 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 211 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 14.0 input capture the input capture module is useful in applications requiring frequency (period) and pulse measurement. the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices support up to four input capture channels. key features of the input capture module include: ? hardware-configurable for 32-bit operation in all modes by cascading two adjacent modules ? synchronous and trigger modes of output compare operation, with up to 31 user-selectable trigger/sync sources available ? a 4-level fifo buffer for capturing and holding timer values for several events ? configurable interrupt generation ? up to six clock sources available for each module, driving a separate internal 16-bit counter figure 14-1: input capture x module block diagram note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 12. ?input cap- ture? (ds70352) of the ? dspic33e/ pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. icxbuf 4-level fifo buffer icx pin icm<2:0> set icxif edge detect logic ici<1:0> icov, icbne interrupt logic system bus prescaler counter 1:1/4/16 and clock synchronizer event and trigger and sync logic clock select ic clock sources trigger and sync sources ictsel<2:0> syncsel<4:0> trigger (1) 16 16 16 icxtmr increment reset note 1: the trigger/sync source is enabled by default and is set to timer3 as a source. this timer must be enabled for proper icx module operation or the trigger/sync source must be changed to another source option. ptg trigger input ctmu edge control logic
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 212 ? 2011-2013 microchip technology inc. 14.1 input capture resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 14.1.1 key resources ? section 12. ?input capture? (ds70352) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 213 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 14.2 input capture registers register 14-1: icxcon1: input capture x control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 ? ? icsidl ictsel<2:0> ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/hc/hs-0 r/hc/hs-0 r/w-0 r/w-0 r/w-0 ? ici<1:0> icov icbne icm<2:0> bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 icsidl: input capture stop in idle control bit 1 = input capture will halt in cpu idle mode 0 = input capture will continue to operate in cpu idle mode bit 12-10 ictsel<12:10>: input capture timer select bits 111 = peripheral clock (f p ) is the clock source of the icx 110 = reserved 101 = reserved 100 = t1clk is the clock source of the icx (only the synchronous clock is supported) 011 = t5clk is the clock source of the icx 010 = t4clk is the clock source of the icx 001 = t2clk is the clock source of the icx 000 = t3clk is the clock source of the icx bit 9-7 unimplemented: read as ? 0 ? bit 6-5 ici<1:0>: number of captures per interrupt select bits (this field is not used if icm<2:0> = 001 or 111 ) 11 = interrupt on every fourth capture event 10 = interrupt on every third capture event 01 = interrupt on every second capture event 00 = interrupt on every capture event bit 4 icov: input capture overflow status flag bit (read-only) 1 = input capture buffer overflow occurred 0 = no input capture buffer overflow occurred bit 3 icbne: input capture buffer not empty status bit (read-only) 1 = input capture buffer is not empty, at least one more capture value can be read 0 = input capture buffer is empty bit 2-0 icm<2:0>: input capture mode select bits 111 = input capture functions as interrupt pin only in cpu sleep and idle modes (rising edge detect only, all other control bits are not applicable) 110 = unused (module is disabled) 101 = capture mode, every 16th rising edge (prescaler capture mode) 100 = capture mode, every 4th rising edge (prescaler capture mode) 011 = capture mode, every rising edge (simple capture mode) 010 = capture mode, every falling edge (simple capture mode) 001 = capture mode, every edge rising and falling (edge detect mode (ici<1:0>) is not used in this mode) 000 = input capture module is turned off
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 214 ? 2011-2013 microchip technology inc. register 14-2: icxcon2: input capture x control register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 ? ? ? ? ? ? ?ic32 bit 15 bit 8 r/w-0 r/w/hs-0 u-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-1 ictrig ( 2 ) trigstat ( 3 ) ? syncsel<4:0> ( 4 ) bit 7 bit 0 legend: hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-9 unimplemented: read as ? 0 ? bit 8 ic32: input capture 32-bit timer mode select bit (cascade mode) 1 = odd ic and even ic form a single 32-bit input capture module ( 1 ) 0 = cascade module operation is disabled bit 7 ictrig: input capture trigger operation select bit ( 2 ) 1 = input source used to trigger the input capture timer (trigger mode) 0 = input source used to synchronize the input capture timer to a timer of another module (synchronization mode) bit 6 trigstat: timer trigger status bit ( 3 ) 1 = icxtmr has been triggered and is running 0 = icxtmr has not been triggered and is being held clear bit 5 unimplemented: read as ? 0 ? note 1: the ic32 bit in both the odd and even ic must be set to enable cascade mode. 2: the input source is selected by the syncsel<4:0> bits of the icxcon2 register. 3: this bit is set by the selected input source (selected by syncsel<4:0> bits). it can be read, set and cleared in software. 4: do not use the icx module as its own sync or trigger source. 5: this option should only be selected as a trigger source and not as a synchronization source. 6: each input capture x (icx) module has one ptg input source. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. ptgo8 = ic1 ptgo9 = ic2 ptgo10 = ic3 ptgo11 = ic4
? 2011-2013 microchip technology inc. ds70657g-page 215 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 4-0 syncsel<4:0>: input source select for synchronization and trigger operation bits ( 4 ) 11111 = no sync or trigger source for icx 11110 = reserved 11101 = reserved 11100 = ctmu module synchronizes or triggers icx 11011 = adc1 module synchronizes or triggers icx ( 5 ) 11010 = cmp3 module synchronizes or triggers icx ( 5 ) 11001 = cmp2 module synchronizes or triggers icx ( 5 ) 11000 = cmp1 module synchronizes or triggers icx ( 5 ) 10111 = reserved 10110 = reserved 10101 = reserved 10100 = reserved 10011 = ic4 module synchronizes or triggers icx 10010 = ic3 module synchronizes or triggers icx 10001 = ic2 module synchronizes or triggers icx 10000 = ic1 module synchronizes or triggers icx 01111 = timer5 synchronizes or triggers icx 01110 = timer4 synchronizes or triggers icx 01101 = timer3 synchronizes or triggers icx (default) 01100 = timer2 synchronizes or triggers icx 01011 = timer1 synchronizes or triggers icx 01010 = ptgox module synchronizes or triggers icx ( 6 ) 01001 = reserved 01000 = reserved 00111 = reserved 00110 = reserved 00101 = reserved 00100 = oc4 module synchronizes or triggers icx 00011 = oc3 module synchronizes or triggers icx 00010 = oc2 module synchronizes or triggers icx 00001 = oc1 module synchronizes or triggers icx 00000 = no sync or trigger source for icx register 14-2: icxcon2: input capture x control register 2 (continued) note 1: the ic32 bit in both the odd and even ic must be set to enable cascade mode. 2: the input source is selected by the syncsel<4:0> bits of the icxcon2 register. 3: this bit is set by the selected input source (selected by syncsel<4:0> bits). it can be read, set and cleared in software. 4: do not use the icx module as its own sync or trigger source. 5: this option should only be selected as a trigger source and not as a synchronization source. 6: each input capture x (icx) module has one ptg input source. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. ptgo8 = ic1 ptgo9 = ic2 ptgo10 = ic3 ptgo11 = ic4
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 216 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 217 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 15.0 output compare the output compare module can select one of eight available clock sources for its time base. the module compares the value of the timer with the value of one or two compare registers depending on the operating mode selected. the state of the output pin changes when the timer value matches the compare register value. the output compare module generates either a single output pulse or a sequence of output pulses, by changing the state of the output pin on the compare match events. the output compare module can also generate interrupts on compare match events and trigger dma data transfers. figure 15-1: output compare x module block diagram note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to comple- ment the information in this data sheet, refer to section 13. ?output compare? (ds70358) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: see section 13. ?output compare? (ds70358) in the ?dspic33e/pic24e family reference manual? for ocxr and ocxrs register restrictions. ocxr buffer comparator ocxtmr ocxcon1 ocxcon2 ocx interrupt ocx pin ocxrs buffer comparator match match trigger and sync logic clock select increment reset oc clock sources trigger and sync sources reset match event ocfa ocxr ocxrs event event rollover rollover/reset rollover/reset ocx synchronization/trigger event ocfb syncsel<4:0> trigger (1) note 1: the trigger/sync source is enabled by default and is set to timer2 as a source. this timer must be enabled for proper ocx module operation or the trigger/sync source must be changed to another source option. ptg trigger input ctmu edge control logic oc output and fault logic
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 218 ? 2011-2013 microchip technology inc. 15.1 output compare resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 15.1.1 key resources ? section 13. ?output compare? (ds70358) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 219 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 15.2 output compare control registers register 15-1: ocxcon1: output compare x control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 ? ? ocsidl octsel<2:0> ?enfltb bit 15 bit 8 r/w-0 u-0 r/w-0, hsc r/w-0, hsc r/w-0 r/w-0 r/w-0 r/w-0 enflta ? ocfltb ocflta trigmode ocm<2:0> bit 7 bit 0 legend: hsc = hardware settable/clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 ocsidl: output compare x stop in idle mode control bit 1 = output compare x halts in cpu idle mode 0 = output compare x continues to operate in cpu idle mode bit 12-10 octsel<2:0>: output compare x clock select bits 111 = peripheral clock (f p ) 110 = reserved 101 = ptgox clock ( 2 ) 100 = t1clk is the clock source of the ocx (only the synchronous clock is supported) 011 = t5clk is the clock source of the ocx 010 = t4clk is the clock source of the ocx 001 = t3clk is the clock source of the ocx 000 = t2clk is the clock source of the ocx bit 9 unimplemented: read as ? 0 ? bit 8 enfltb: fault b input enable bit 1 = output compare fault b input (ocfb) is enabled 0 = output compare fault b input (ocfb) is disabled bit 7 enflta: fault a input enable bit 1 = output compare fault a input (ocfa) is enabled 0 = output compare fault a input (ocfa) is disabled bit 6 unimplemented: read as ? 0 ? bit 5 ocfltb: pwm fault b condition status bit 1 = pwm fault b condition on ocfb pin has occurred 0 = no pwm fault b condition on ocfb pin has occurred bit 4 ocflta: pwm fault a condition status bit 1 = pwm fault a condition on ocfa pin has occurred 0 = no pwm fault a condition on ocfa pin has occurred note 1: ocxr and ocxrs are double-buffered in pwm mode only. 2: each output compare x module (ocx) has one ptg clock source. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. ptgo4 = oc1 ptgo5 = oc2 ptgo6 = oc3 ptgo7 = oc4
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 220 ? 2011-2013 microchip technology inc. bit 3 trigmode: trigger status mode select bit 1 = trigstat (ocxcon2<6>) is cleared when ocxrs = ocxtmr or in software 0 = trigstat is cleared only by software bit 2-0 ocm<2:0>: output compare x mode select bits 111 = center-aligned pwm mode: output set high when ocxtmr = ocxr and set low when ocxtmr = ocxrs (1) 110 = edge-aligned pwm mode: output set high when ocxtmr = 0 and set low when ocxtmr = ocxr ( 1 ) 101 = double compare continuous pulse mode: initializes ocx pin low, toggles ocx state continuously on alternate matches of ocxr and ocxrs 100 = double compare single-shot mode: initializes ocx pin low, toggles ocx state on matches of ocxr and ocxrs for one cycle 011 = single compare mode: compare event with ocxr, continuously toggles ocx pin 010 = single compare single-shot mode: initializes ocx pin high, compare event with ocxr, forces ocx pin low 001 = single compare single-shot mode: initializes ocx pin low, compare event with ocxr, forces ocx pin high 000 = output compare channel is disabled register 15-1: ocxcon1: output compare x control register 1 (continued) note 1: ocxr and ocxrs are double-buffered in pwm mode only. 2: each output compare x module (ocx) has one ptg clock source. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. ptgo4 = oc1 ptgo5 = oc2 ptgo6 = oc3 ptgo7 = oc4
? 2011-2013 microchip technology inc. ds70657g-page 221 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 15-2: ocxcon2: output compare x control register 2 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 fltmd fltout flttrien ocinv ? ? ?oc32 bit 15 bit 8 r/w-0 r/w-0, hs r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 octrig trigstat octris syncsel<4:0> bit 7 bit 0 legend: hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 fltmd: fault mode select bit 1 = fault mode is maintained until the fault source is removed; the corresponding ocfltx bit is cleared in software and a new pwm period starts 0 = fault mode is maintained until the fault source is removed and a new pwm period starts bit 14 fltout: fault out bit 1 = pwm output is driven high on a fault 0 = pwm output is driven low on a fault bit 13 flttrien: fault output state select bit 1 = ocx pin is tri-stated on a fault condition 0 = ocx pin i/o state is defined by the fltout bit on a fault condition bit 12 ocinv: output compare x invert bit 1 = ocx output is inverted 0 = ocx output is not inverted bit 11-9 unimplemented: read as ? 0 ? bit 8 oc32: cascade two ocx modules enable bit (32-bit operation) 1 = cascade module operation is enabled 0 = cascade module operation is disabled bit 7 octrig: output compare x trigger/sync select bit 1 = triggers ocx from the source designated by the syncselx bits 0 = synchronizes ocx with the source designated by the syncselx bits bit 6 trigstat: timer trigger status bit 1 = timer source has been triggered and is running 0 = timer source has not been triggered and is being held clear bit 5 octris: output compare x output pin direction select bit 1 = ocx is tri-stated 0 = output compare x module drives the ocx pin note 1: do not use the ocx module as its own synchronization or trigger source. 2: when the ocy module is turned off, it sends a trigger out signal. if the ocx module uses the ocy module as a trigger source, the ocy module must be unselected as a trigger source prior to disabling it. 3: each output compare x module (ocx) has one ptg trigger/synchronization source. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. ptgo0 = oc1 ptgo1 = oc2 ptgo2 = oc3 ptgo3 = oc4
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 222 ? 2011-2013 microchip technology inc. bit 4-0 syncsel<4:0>: trigger/synchronization source selection bits 11111 = ocxrs compare event is used for synchronization 11110 = int2 pin synchronizes or triggers ocx 11101 = int1 pin synchronizes or triggers ocx 11100 = ctmu module synchronizes or triggers ocx 11011 = adc1 module synchronizes or triggers ocx 11010 = cmp3 module synchronizes or triggers ocx 11001 = cmp2 module synchronizes or triggers ocx 11000 = cmp1 module synchronizes or triggers ocx 10111 = reserved 10110 = reserved 10101 = reserved 10100 = reserved 10011 = ic4 input capture event synchronizes or triggers ocx 10010 = ic3 input capture event synchronizes or triggers ocx 10001 = ic2 input capture event synchronizes or triggers ocx 10000 = ic1 input capture event synchronizes or triggers ocx 01111 = timer5 synchronizes or triggers ocx 01110 = timer4 synchronizes or triggers ocx 01101 = timer3 synchronizes or triggers ocx 01100 = timer2 synchronizes or triggers ocx (default) 01011 = timer1 synchronizes or triggers ocx 01010 = ptgox synchronizes or triggers ocx ( 3 ) 01001 = reserved 01000 = reserved 00111 = reserved 00110 = reserved 00101 = reserved 00100 = oc4 module synchronizes or triggers ocx ( 1 , 2 ) 00011 = oc3 module synchronizes or triggers ocx ( 1 , 2 ) 00010 = oc2 module synchronizes or triggers ocx ( 1 , 2 ) 00001 = oc1 module synchronizes or triggers ocx ( 1 , 2 ) 00000 = no sync or trigger source for ocx register 15-2: ocxcon2: output comp are x control register 2 (continued) note 1: do not use the ocx module as its own synchronization or trigger source. 2: when the ocy module is turned off, it sends a trigger out signal. if the ocx module uses the ocy module as a trigger source, the ocy module must be unselected as a trigger source prior to disabling it. 3: each output compare x module (ocx) has one ptg trigger/synchronization source. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. ptgo0 = oc1 ptgo1 = oc2 ptgo2 = oc3 ptgo3 = oc4
? 2011-2013 microchip technology inc. ds70657g-page 223 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 16.0 high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) the dspic33epxxxmc20x/50x and pic24epxxxmc20x devices support a dedicated pulse-width modulation (pwm) module with up to 6 outputs. the high-speed pwmx module consists of the following major features: ? three pwm generators ? two pwm outputs per pwm generator ? individual period and duty cycle for each pwm pair ? duty cycle, dead time, phase shift and frequency resolution of 8.32 ns ? independent fault and current-limit inputs for six pwm outputs ? redundant output ? center-aligned pwm mode ? output override control ? chop mode (also known as gated mode) ? special event trigger ? prescaler for input clock ? pwmxl and pwmxh output pin swapping ? independent pwm frequency, duty cycle and phase-shift changes for each pwm generator ? dead-time compensation ? enhanced leading-edge blanking (leb) functionality ? frequency resolution enhancement ? pwm capture functionality the high-speed pwmx module contains up to three pwm generators. each pwm generator provides two pwm outputs: pwmxh and pwmxl . the master time base generator provides a synchronous signal as a common time base to synchronize the various pwm outputs. the individual pwm outputs are available on the output pins of the device. the input fault signals and current-limit signals, when enabled, can monitor and protect the system by placing the pwm outputs into a known ?safe? state. each pwmx can generate a trigger to the adc module to sample the analog signal at a specific instance dur- ing the pwm period. in addition, the high-speed pwmx module also generates a special event trigger to the adc module based on either of the two master time bases. the high-speed pwmx module can synchronize itself with an external signal or can act as a synchronizing source to any external device. the synci1 input pin that utilizes pps, can synchronize the high-speed pwmx module with an external signal. the synco1 pin is an output pin that provides a synchronous signal to an external device. figure 16-1 illustrates an architectural overview of the high-speed pwmx module and its interconnection with the cpu and other peripherals. 16.1 pwm faults the pwmx module incorporates multiple external fault inputs to include flt1 and flt2 which are re- mappable using the pps feature, flt3 and flt4 which are available only on the larger 44-pin and 64-pin packages, and flt32 which has been implemented with class b safety features, and is available on a fixed pin on all dspic33epxxxmc20x/50x and pic24epxxxmc20x devices. these faults provide a safe and reliable way to safely shut down the pwm outputs when the fault input is asserted. 16.1.1 pwm faults at reset during any reset event, the pwmx module maintains ownership of the class b fault, flt32. at reset, this fault is enabled in latched mode to ensure the fail-safe power-up of the application. the application software must clear the pwm fault before enabling the high- speed motor control pwmx module. to clear the fault condition, the flt32 pin must first be pulled low externally or the internal pull-down resistor in the cnpdx register can be enabled. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 14. ?high-speed pwm? (ds70645) of the ? dspic33e/ pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: in edge-aligned pwm mode, the duty cycle, dead time, phase shift and frequency resolution are 8.32 ns. note: the fault mode may be changed using the fltmod<1:0> bits (fclcon<1:0>), regardless of the state of flt32.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 224 ? 2011-2013 microchip technology inc. 16.1.2 write-protected registers on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices, write protection is implemented for the ioconx and fclconx registers. the write protection feature prevents any inadvertent writes to these registers. this protection feature can be controlled by the pwmlock configuration bit (foscsel<6>). the default state of the write protection feature is enabled (pwmlock = 1 ). the write protection feature can be disabled by configuring, pwmlock = 0 . to gain write access to these locked registers, the user application must write two consecutive values of (0xabcd and 0x4321) to the pwmkey register to perform the unlock operation. the write access to the ioconx or fclconx registers must be the next sfr access following the unlock process. there can be no other sfr accesses during the unlock process and subsequent write access. to write to both the ioconx and fclconx registers requires two unlock operations. the correct unlocking sequence is described in example 16-1 . example 16-1: pwmx write-protec ted register unlock sequence ; flt32 pin must be pulled low externally in order to clear and disable the fault ; writing to fclcon1 register requires unlock sequence mov #0xabcd,w10 ; load first unlock key to w10 register mov #0x4321,w11 ; load second unlock key to w11 register mov #0x0000,w0 ; load desired value of fclcon1 register in w0 mov w10, pwmkey ; write first unlock key to pwmkey register mov w11, pwmkey ; write second unlock key to pwmkey register mov w0,fclcon1 ; write desired value to fclcon1 register ; set pwm ownership and polarity using the iocon1 register ; writing to iocon1 register requires unlock sequence mov #0xabcd,w10 ; load first unlock key to w10 register mov #0x4321,w11 ; load second unlock key to w11 register mov #0xf000,w0 ; load desired value of iocon1 register in w0 mov w10, pwmkey ; write first unlock key to pwmkey register mov w11, pwmkey ; write second unlock key to pwmkey register mov w0,iocon1 ; write desired value to iocon1 register
? 2011-2013 microchip technology inc. ds70657g-page 225 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 16-1: high-speed pwmx module architectural overview cpu pwm generator 1 pwm generator 3 synci1 synco1 pwm1h pwm1l pwm1 interrupt (1) pwm2h pwm2l pwm2 interrupt (1) pwm3h pwm3l pwm3 interrupt (1) synchronization signal data bus adc module flt1-flt4, flt32 synchronization signal synchronization signal primary trigger primary special dtcmp1-dtcmp3 fault, current-limit and dead-time compensation event trigger master time base fault, current-limit and dead-time compensation fault, current-limit and dead-time compensation f osc note 1: the pwm interrupts are generated by logically oring the fltstat, clstat and trgstat status bits for the given pwm generator. refer to the ? dspic33e/pic24e family reference manual ?, section 14. ?high-speed pwm? (ds70645) for more information. pwm generator 2
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 226 ? 2011-2013 microchip technology inc. figure 16-2: high-speed pwmx modul e register interconnection diagram mux ptmrx pdcx pwmconx, ptcon, ptcon2 ioconx dtrx pwmxl pwmxh fltx pwm1l pwm1h fclconx mdc phasex lebconx, altdtrx user override logic current-limit pwm output mode control logic logic pin control logic fault and current-limit logic pwm generator 1 fltx pwm generator 2 and pwm generator 3 interrupt logic (1) module control and timing master duty cycle register synchronization synchronization master period master period master duty cycle master duty cycle synci1 synco1 sevtcmp comparator special event trigger special event postscaler ptper pmtmr primary master time base master time base counter special event compare trigger comparator clock prescaler comparator dead-time fault override logic override logic dtcmpx dtcmp1 f osc pwmkey ioconx and fclconx unlock register auxconx lebdlyx ptg trigger input ptg trigger input ptg trigger input trgconx pwmcapx adc trigger comparator trigx 16-bit data bus note 1: the pwm interrupts are generated by logically oring the fltstat, clstat and trgstat status bits for the given pwm generator. refer to the ? dspic33e/pic24e family reference manual ?, section 14. ?high-speed pwm? (ds70645) for more information.
? 2011-2013 microchip technology inc. ds70657g-page 227 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 16.2 pwm resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 16.2.1 key resources ? section 14. ?high-speed pwm? (ds70645) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 228 ? 2011-2013 microchip technology inc. 16.3 pwmx control registers register 16-1: ptcon: pwmx time base control register r/w-0 u-0 r/w-0 hs/hc-0 r/w-0 r/w-0 r/w-0 r/w-0 pten ? ptsidl sestat seien eipu ( 1 ) syncpol ( 1 ) syncoen ( 1 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 syncen ( 1 ) syncsrc<2:0> ( 1 ) sevtps<3:0> ( 1 ) bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 pten: pwmx module enable bit 1 = pwmx module is enabled 0 = pwmx module is disabled bit 14 unimplemented: read as ? 0 ? bit 13 ptsidl: pwmx time base stop in idle mode bit 1 = pwmx time base halts in cpu idle mode 0 = pwmx time base runs in cpu idle mode bit 12 sestat: special event interrupt status bit 1 = special event interrupt is pending 0 = special event interrupt is not pending bit 11 seien: special event interrupt enable bit 1 = special event interrupt is enabled 0 = special event interrupt is disabled bit 10 eipu: enable immediate period updates bit ( 1 ) 1 = active period register is updated immediately 0 = active period register updates occur on pwmx cycle boundaries bit 9 syncpol: synchronize input and output polarity bit ( 1 ) 1 = synci1/synco1 polarity is inverted (active-low) 0 = synci1/synco1 is active-high bit 8 syncoen: primary time base sync enable bit ( 1 ) 1 = synco1 output is enabled 0 = synco1 output is disabled bit 7 syncen: external time base synchronization enable bit ( 1 ) 1 = external synchronization of primary time base is enabled 0 = external synchronization of primary time base is disabled note 1: these bits should be changed only when pten = 0 . in addition, when using the synci1 feature, the user application must program the period register with a value that is slightly larger than the expected period of the external synchronization input signal. 2: see section 24.0 ?peripheral trigger generator (ptg) module? for information on this selection.
? 2011-2013 microchip technology inc. ds70657g-page 229 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 6-4 syncsrc<2:0>: synchronous source selection bits ( 1 ) 111 = reserved ? ? ? 100 = reserved 011 = ptgo17 ( 2 ) 010 = ptgo16 ( 2 ) 001 = reserved 000 = synci 1 input from pps bit 3-0 sevtps<3:0>: pwmx special event trigger output postscaler select bits ( 1 ) 1111 = 1:16 postscaler generates special event trigger on every sixteenth compare match event ? ? ? 0001 = 1:2 postscaler generates special event trigger on every second compare match event 0000 = 1:1 postscaler generates special event trigger on every compare match event register 16-1: ptcon: pwmx time base control register (continued) note 1: these bits should be changed only when pten = 0 . in addition, when using the synci1 feature, the user application must program the period register with a value that is slightly larger than the expected period of the external synchronization input signal. 2: see section 24.0 ?peripheral trigger generator (ptg) module? for information on this selection.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 230 ? 2011-2013 microchip technology inc. register 16-2: ptcon2: pwmx primary ma ster clock divider select register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? pclkdiv<2:0> ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-3 unimplemented: read as ? 0 ? bit 2-0 pclkdiv<2:0>: pwmx input clock prescaler (divider) select bits ( 1 ) 111 = reserved 110 = divide-by-64 101 = divide-by-32 100 = divide-by-16 011 = divide-by-8 010 = divide-by-4 001 = divide-by-2 000 = divide-by-1, maximum pwmx timing resolution (power-on default) note 1: these bits should be changed only when pten = 0 . changing the clock selection during operation will yield unpredictable results.
? 2011-2013 microchip technology inc. ds70657g-page 231 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 16-3: ptper: pwmx primary master time base period register r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 ptper<15:8> bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 ptper<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptper<15:0>: primary master time base (pmtmr) period value bits register 16-4: sevtcmp: pwmx primary special event compare register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sevtcmp<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sevtcmp<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 sevtcmp<15:0>: special event compare count value bits
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 232 ? 2011-2013 microchip technology inc. register 16-5: chop: pwmx ch op clock generator register r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 chpclken ? ? ? ? ?chop<9:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 chop<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 chpclken: enable chop clock generator bit 1 = chop clock generator is enabled 0 = chop clock generator is disabled bit 14-10 unimplemented: read as ? 0 ? bit 9-0 chop<9:0>: chop clock divider bits the frequency of the chop clock signal is given by the following expression: chop frequency = (f p /pclkdiv<2:0)/(chop<9:0> + 1) register 16-6: mdc: pwmx master duty cycle register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 mdc<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 mdc<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 mdc<15:0>: pwmx master duty cycle value bits
? 2011-2013 microchip technology inc. ds70657g-page 233 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 16-7: pwmconx: pwmx control register hs/hc-0 hs/hc-0 hs/hc-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 fltstat ( 1 ) clstat ( 1 ) trgstat fltien clien trgien itb ( 2 ) mdcs ( 2 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 dtc<1:0> dtcp ( 3 ) ?mtbscam ( 2 , 4 ) xpres ( 5 ) iue ( 2 ) bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 fltstat: fault interrupt status bit ( 1 ) 1 = fault interrupt is pending 0 = no fault interrupt is pending this bit is cleared by setting fltien = 0 . bit 14 clstat: current-limit interrupt status bit ( 1 ) 1 = current-limit interrupt is pending 0 = no current-limit interrupt is pending this bit is cleared by setting clien = 0 . bit 13 trgstat: trigger interrupt status bit 1 = trigger interrupt is pending 0 = no trigger interrupt is pending this bit is cleared by setting trgien = 0 . bit 12 fltien: fault interrupt enable bit 1 = fault interrupt is enabled 0 = fault interrupt is disabled and the fltstat bit is cleared bit 11 clien: current-limit interrupt enable bit 1 = current-limit interrupt is enabled 0 = current-limit interrupt is disabled and the clstat bit is cleared bit 10 trgien: trigger interrupt enable bit 1 = a trigger event generates an interrupt request 0 = trigger event interrupts are disabled and the trgstat bit is cleared bit 9 itb: independent time base mode bit ( 2 ) 1 = phasex register provides time base period for this pwm generator 0 = ptper register provides timing for this pwm generator bit 8 mdcs: master duty cycle register select bit ( 2 ) 1 = mdc register provides duty cycle information for this pwm generator 0 = pdcx register provides duty cycle information for this pwm generator note 1: software must clear the interrupt status here and in the corresponding ifsx bit in the interrupt controller. 2: these bits should not be changed after the pwmx is enabled (pten = 1 ). 3: dtc<1:0> = 11 for dtcp to be effective; otherwise, dtcp is ignored. 4: the independent time base (itb = 1 ) mode must be enabled to use center-aligned mode. if itb = 0 , the cam bit is ignored. 5: to operate in external period reset mode, the itb bit must be ? 1 ? and the clmod bit in the fclconx register must be ? 0 ?.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 234 ? 2011-2013 microchip technology inc. bit 7-6 dtc<1:0>: dead-time control bits 11 = dead-time compensation mode 10 = dead-time function is disabled 01 = negative dead time is actively applied for complementary output mode 00 = positive dead time is actively applied for all output modes bit 5 dtcp: dead-time compensation polarity bit ( 3 ) when set to ? 1 ?: if dtcmpx = 0 , pwmxl is shortened and pwmxh is lengthened. if dtcmpx = 1 , pwmxh is shortened and pwmxl is lengthened. when set to ? 0 ?: if dtcmpx = 0 , pwmxh is shortened and pwmxl is lengthened. if dtcmpx = 1 , pwmxl is shortened and pwmxh is lengthened. bit 4 unimplemented: read as ? 0 ? bit 3 mtbs: master time base select bit 1 = pwm generator uses the secondary master time base for synchronization and as the clock source for the pwm generation logic (if secondary time base is available) 0 = pwm generator uses the primary master time base for synchronization and as the clock source for the pwm generation logic bit 2 cam: center-aligned mode enable bit ( 2 , 4 ) 1 = center-aligned mode is enabled 0 = edge-aligned mode is enabled bit 1 xpres: external pwmx reset control bit ( 5 ) 1 = current-limit source resets the time base for this pwm generator if it is in independent time base mode 0 = external pins do not affect pwmx time base bit 0 iue: immediate update enable bit ( 2 ) 1 = updates to the active mdc/pdcx/dtx/altdtrx/phasex registers are immediate 0 = updates to the active mdc/pdcx/dtx/altdtrx/phasex registers are synchronized to the pwmx period boundary register 16-7: pwmconx: pwmx control register (continued) note 1: software must clear the interrupt status here and in the corresponding ifsx bit in the interrupt controller. 2: these bits should not be changed after the pwmx is enabled (pten = 1 ). 3: dtc<1:0> = 11 for dtcp to be effective; otherwise, dtcp is ignored. 4: the independent time base (itb = 1 ) mode must be enabled to use center-aligned mode. if itb = 0 , the cam bit is ignored. 5: to operate in external period reset mode, the itb bit must be ? 1 ? and the clmod bit in the fclconx register must be ? 0 ?.
? 2011-2013 microchip technology inc. ds70657g-page 235 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 16-8: pdcx: pwmx generator duty cycle register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pdcx<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pdcx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 pdcx<15:0>: pwmx generator # duty cycle value bits register 16-9: phasex: pwmx primary phase-shift register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 phasex<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 phasex<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 phasex<15:0>: pwmx phase-shift value or independent time base period for the pwm generator bits note 1: if itb (pwmconx<9>) = 0 , the following applies based on the mode of operation: complementary, redundant and push-pull output mode (pmod<1:0> (iocon<11:10>) = 00 , 01 or 10 ), phasex<15:0> = phase-shift value for pwmxh and pwmxl outputs 2: if itb (pwmconx<9>) = 1 , the following applies based on the mode of operation: complementary, redundant and push-pull output mode (pmod<1:0> (ioconx<11:10>) = 00 , 01 or 10 ), phasex<15:0> = independent time base period value for pwmxh and pwmxl
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 236 ? 2011-2013 microchip technology inc. register 16-10: dtrx: pwmx dead-time register u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?dtrx<13:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 dtrx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-0 dtrx<13:0>: unsigned 14-bit dead-time value for pwmx dead-time unit bits register 16-11: altdtrx: pwmx alternate dead-time register u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? altdtrx<13:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 altdtrx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-0 altdtrx<13:0>: unsigned 14-bit dead-time value for pwmx dead-time unit bits
? 2011-2013 microchip technology inc. ds70657g-page 237 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 16-12: trgconx: pwmx trigger control register r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 trgdiv<3:0> ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?trgstrt<5:0> ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 trgdiv<3:0>: trigger # output divider bits 1111 = trigger output for every 16th trigger event 1110 = trigger output for every 15th trigger event 1101 = trigger output for every 14th trigger event 1100 = trigger output for every 13th trigger event 1011 = trigger output for every 12th trigger event 1010 = trigger output for every 11th trigger event 1001 = trigger output for every 10th trigger event 1000 = trigger output for every 9th trigger event 0111 = trigger output for every 8th trigger event 0110 = trigger output for every 7th trigger event 0101 = trigger output for every 6th trigger event 0100 = trigger output for every 5th trigger event 0011 = trigger output for every 4th trigger event 0010 = trigger output for every 3rd trigger event 0001 = trigger output for every 2nd trigger event 0000 = trigger output for every trigger event bit 11-6 unimplemented: read as ? 0 ? bit 5-0 trgstrt<5:0>: trigger postscaler start enable select bits ( 1 ) 111111 = waits 63 pwm cycles before generating the first trigger event after the module is enabled ? ? ? 000010 = waits 2 pwm cycles before generating the first trigger event after the module is enabled 000001 = waits 1 pwm cycle before generating the first trigger event after the module is enabled 000000 = waits 0 pwm cycles before generating the first trigger event after the module is enabled note 1: the secondary pwm generator cannot generate pwmx trigger interrupts.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 238 ? 2011-2013 microchip technology inc. register 16-13: ioconx: pw mx i/o control register ( 2 ) r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 penh penl polh poll pmod<1:0> ( 1 ) ovrenh ovrenl bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ovrdat<1:0> fltdat<1:0> cldat<1:0> swap osync bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 penh: pwmxh output pin ownership bit 1 = pwmx module controls pwmxh pin 0 = gpio module controls pwmxh pin bit 14 penl: pwmxl output pin ownership bit 1 = pwmx module controls pwmxl pin 0 = gpio module controls pwmxl pin bit 13 polh: pwmxh output pin polarity bit 1 = pwmxh pin is active-low 0 = pwmxh pin is active-high bit 12 poll: pwmxl output pin polarity bit 1 = pwmxl pin is active-low 0 = pwmxl pin is active-high bit 11-10 pmod<1:0>: pwmx # i/o pin mode bits ( 1 ) 11 = reserved; do not use 10 = pwmx i/o pin pair is in the push-pull output mode 01 = pwmx i/o pin pair is in the redundant output mode 00 = pwmx i/o pin pair is in the complementary output mode bit 9 ovrenh: override enable for pwmxh pin bit 1 = ovrdat<1> controls output on pwmxh pin 0 = pwmx generator controls pwmxh pin bit 8 ovrenl: override enable for pwmxl pin bit 1 = ovrdat<0> controls output on pwmxl pin 0 = pwmx generator controls pwmxl pin bit 7-6 ovrdat<1:0>: data for pwmxh, pwmxl pins if override is enabled bits if overenh = 1 , pwmxh is driven to the state specified by ovrdat<1>. if overenl = 1 , pwmxl is driven to the state specified by ovrdat<0>. bit 5-4 fltdat<1:0>: data for pwmxh and pwmxl pins if fltmod is enabled bits if fault is active, pwmxh is driven to the state specified by fltdat<1>. if fault is active, pwmxl is driven to the state specified by fltdat<0>. bit 3-2 cldat<1:0>: data for pwmxh and pwmxl pins if clmod is enabled bits if current-limit is active, pwmxh is driven to the state specified by cldat<1>. if current-limit is active, pwmxl is driven to the state specified by cldat<0>. note 1: these bits should not be changed after the pwmx module is enabled (pten = 1 ). 2: if the pwmlock configuration bit (foscsel<6>) is a ? 1 ?, the ioconx register can only be written after the unlock sequence has been executed.
? 2011-2013 microchip technology inc. ds70657g-page 239 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 1 swap: swap pwmxh and pwmxl pins bit 1 = pwmxh output signal is connected to pwmxl pins; pwmxl output signal is connected to pwmxh pins 0 = pwmxh and pwmxl pins are mapped to their respective pins bit 0 osync: output override synchronization bit 1 = output overrides via the ovrdat<1:0> bits are synchronized to the pwmx time base 0 = output overrides via the ovddat<1:0> bits occur on the next cpu clock boundary register 16-13: ioconx: pw mx i/o control register ( 2 ) (continued) note 1: these bits should not be changed after the pwmx module is enabled (pten = 1 ). 2: if the pwmlock configuration bit (foscsel<6>) is a ? 1 ?, the ioconx register can only be written after the unlock sequence has been executed.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 240 ? 2011-2013 microchip technology inc. register 16-14: trigx: pwmx primary trigger compare value register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgcmp<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgcmp<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 trgcmp<15:0>: trigger control value bits when the primary pwmx functions in local time base, this register contains the compare values that can trigger the adc module.
? 2011-2013 microchip technology inc. ds70657g-page 241 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 16-15: fclconx: pwmx fau lt current-limit control register ( 1 ) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? clsrc<4:0> clpol ( 2 ) clmod bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 fltsrc<4:0> fltpol ( 2 ) fltmod<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-10 clsrc<4:0>: current-limit control signal source select for pwm generator # bits 11111 = fault 32 11110 = reserved ? ? ? 01100 = reserved 01011 = comparator 4 01010 = op amp/comparator 3 01001 = op amp/comparator 2 01000 = op amp/comparator 1 00111 = reserved 00110 = reserved 00101 = reserved 00100 = reserved 00011 = fault 4 00010 = fault 3 00001 = fault 2 00000 = fault 1 (default) bit 9 clpol: current-limit polarity for pwm generator # bit ( 2 ) 1 = the selected current-limit source is active-low 0 = the selected current-limit source is active-high bit 8 clmod: current-limit mode enable for pwm generator # bit 1 = current-limit mode is enabled 0 = current-limit mode is disabled note 1: if the pwmlock configuration bit (foscsel<6>) is a ? 1 ?, the ioconx register can only be written after the unlock sequence has been executed. 2: these bits should be changed only when pten = 0 . changing the clock selection during operation will yield unpredictable results.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 242 ? 2011-2013 microchip technology inc. bit 7-3 fltsrc<4:0>: fault control signal source select for pwm generator # bits 11111 = fault 32 (default) 11110 = reserved ? ? ? 01100 = reserved 01011 = comparator 4 01010 = op amp/comparator 3 01001 = op amp/comparator 2 01000 = op amp/comparator 1 00111 = reserved 00110 = reserved 00101 = reserved 00100 = reserved 00011 = fault 4 00010 = fault 3 00001 = fault 2 00000 = fault 1 bit 2 fltpol: fault polarity for pwm generator # bit ( 2 ) 1 = the selected fault source is active-low 0 = the selected fault source is active-high bit 1-0 fltmod<1:0>: fault mode for pwm generator # bits 11 = fault input is disabled 10 = reserved 01 = the selected fault source forces pwmxh, pwmxl pins to fltdat values (cycle) 00 = the selected fault source forces pwmxh, pwmxl pins to fltdat values (latched condition) register 16-15: fclconx: pwmx fau lt current-limit control register ( 1 ) note 1: if the pwmlock configuration bit (foscsel<6>) is a ? 1 ?, the ioconx register can only be written after the unlock sequence has been executed. 2: these bits should be changed only when pten = 0 . changing the clock selection during operation will yield unpredictable results.
? 2011-2013 microchip technology inc. ds70657g-page 243 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 16-16: lebconx: pwmx leadi ng-edge blanking control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 phr phf plr plf fltleben clleben ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?bch ( 1 ) bcl ( 1 ) bphh bphl bplh bpll bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 phr: pwmxh rising edge trigger enable bit 1 = rising edge of pwmxh will trigger leading-edge blanking counter 0 = leading-edge blanking ignores rising edge of pwmxh bit 14 phf: pwmxh falling edge trigger enable bit 1 = falling edge of pwmxh will trigger leading-edge blanking counter 0 = leading-edge blanking ignores falling edge of pwmxh bit 13 plr: pwmxl rising edge trigger enable bit 1 = rising edge of pwmxl will trigger leading-edge blanking counter 0 = leading-edge blanking ignores rising edge of pwmxl bit 12 plf: pwmxl falling edge trigger enable bit 1 = falling edge of pwmxl will trigger leading-edge blanking counter 0 = leading-edge blanking ignores falling edge of pwmxl bit 11 fltleben: fault input leading-edge blanking enable bit 1 = leading-edge blanking is applied to selected fault input 0 = leading-edge blanking is not applied to selected fault input bit 10 clleben: current-limit leading-edge blanking enable bit 1 = leading-edge blanking is applied to selected current-limit input 0 = leading-edge blanking is not applied to selected current-limit input bit 9-6 unimplemented: read as ? 0 ? bit 5 bch: blanking in selected blanking signal high enable bit ( 1 ) 1 = state blanking (of current-limit and/or fault input signals) when selected blanking signal is high 0 = no blanking when selected blanking signal is high bit 4 bcl: blanking in selected blanking signal low enable bit ( 1 ) 1 = state blanking (of current-limit and/or fault input signals) when selected blanking signal is low 0 = no blanking when selected blanking signal is low bit 3 bphh: blanking in pwmxh high enable bit 1 = state blanking (of current-limit and/or fault input signals) when pwmxh output is high 0 = no blanking when pwmxh output is high bit 2 bphl: blanking in pwmxh low enable bit 1 = state blanking (of current-limit and/or fault input signals) when pwmxh output is low 0 = no blanking when pwmxh output is low bit 1 bplh: blanking in pwmxl high enable bit 1 = state blanking (of current-limit and/or fault input signals) when pwmxl output is high 0 = no blanking when pwmxl output is high bit 0 bpll: blanking in pwmxl low enable bit 1 = state blanking (of current-limit and/or fault input signals) when pwmxl output is low 0 = no blanking when pwmxl output is low note 1: the blanking signal is selected via the blankselx bits in the auxconx register.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 244 ? 2011-2013 microchip technology inc. register 16-17: lebdlyx: pwmx leadi ng-edge blanking delay register u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ? leb<11:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 leb<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-0 leb<11:0>: leading-edge blanking delay for current-limit and fault inputs bits
? 2011-2013 microchip technology inc. ds70657g-page 245 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 16-18: auxconx: pwmx auxiliary control register u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ? blanksel<3:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? chopsel<3:0> chophen choplen bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-8 blanksel<3:0>: pwmx state blank source select bits the selected state blank signal will block the current-limit and/or fault input signals (if enabled via the bch and bcl bits in the lebconx register). 1001 = reserved ? ? ? 0100 = reserved 0011 = pwm3h selected as state blank source 0010 = pwm2h selected as state blank source 0001 = pwm1h selected as state blank source 0000 = no state blanking bit 7-6 unimplemented: read as ? 0 ? bit 5-2 chopsel<3:0>: pwmx chop clock source select bits the selected signal will enable and disable (chop) the selected pwmx outputs. 1001 = reserved ? ? ? 0100 = reserved 0011 = pwm3h selected as chop clock source 0010 = pwm2h selected as chop clock source 0001 = pwm1h selected as chop clock source 0000 = chop clock generator selected as chop clock source bit 1 chophen: pwmxh output chopping enable bit 1 = pwmxh chopping function is enabled 0 = pwmxh chopping function is disabled bit 0 choplen: pwmxl output chopping enable bit 1 = pwmxl chopping function is enabled 0 = pwmxl chopping function is disabled
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 246 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 247 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 17.0 quadrature encoder interface (qei) module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) this chapter describes the quadrature encoder inter- face (qei) module and associated operational modes. the qei module provides the interface to incremental encoders for obtaining mechanical position data. the operational features of the qei module include: ? 32-bit position counter ? 32-bit index pulse counter ? 32-bit interval timer ? 16-bit velocity counter ? 32-bit position initialization/capture/compare high register ? 32-bit position compare low register ? x4 quadrature count mode ? external up/down count mode ? external gated count mode ? external gated timer mode ? internal timer mode figure 17-1 illustrates the qei block diagram. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to section 15. ?quadrature encoder interface (qei)? (ds70601) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 248 ? 2011-2013 microchip technology inc. figure 17-1: qei block diagram quadrature decoder logic cntcmpx qebx qeax indxx count dir f p count count _ en 32-bit greater than or equal compare register 32-bit index counter register digital filter homex fhomex data bus 32-bit greater than data bus count _ en cnt _ dir cnt _ dir findxx findxx pcheq 32-bit interval timer 16-bit index counter hold register 32-bit interval timer register hold register count _ en f p pchge extcnt extcnt dir _ gate 16-bit velocity count _ en cnt _ dir counter register pclle pchge divclk dir cnt _ dir dir _ gate 1?b0 pclle cntpol dir _ gate gaten 0 1 divclk or equal comparator 32-bit less than pclle or equal comparator pcleq pchge ? qfdiv ccm ? intdiv (velxcnt) (intxtmr) (intxhld) (indxxcnt) (indxxhld) indxxcntl indxxcnth posxcntl posxcnth (qei1gec) (1) 32-bit less than or equal compare register (qei1lec) 16-bit position counter hold register (posxhld) 32-bit initialization and capture register (qei1ic) (1) qcapen note 1: these registers map to the same memory location. outfnc fltren (posxcnt) 32-bit position counter register
? 2011-2013 microchip technology inc. ds70657g-page 249 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 17.1 qei resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 17.1.1 key resources ? section 15. ?quadrature encoder interface? (ds70601) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 250 ? 2011-2013 microchip technology inc. 17.2 qei control registers register 17-1: qei1con: qei control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeien ? qeisidl pimod<2:0> ( 1 ) imv1 ( 2 ) imv0 ( 2 ) bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? intdiv<2:0> ( 3 ) cntpol gaten ccm<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 qeien: quadrature encoder interface module counter enable bit 1 = module counters are enabled 0 = module counters are disabled, but sfrs can be read or written to bit 14 unimplemented: read as ? 0 ? bit 13 qeisidl: qei stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-10 pimod<2:0>: position counter initialization mode select bits ( 1 ) 111 = reserved 110 = modulo count mode for position counter 101 = resets the position counter when the position counter equals qei1gec register 100 = second index event after home event initializes position counter with contents of qei1ic register 011 = first index event after home event initializes position counter with contents of qei1ic register 010 = next index input event initializes the position counter with contents of qei1ic register 001 = every index input event resets the position counter 000 = index input event does not affect position counter bit 9 imv1: index match value for phase b bit ( 2 ) 1 = phase b match occurs when qeb = 1 0 = phase b match occurs when qeb = 0 bit 8 imv0: index match value for phase a bit ( 2 ) 1 = phase a match occurs when qea = 1 0 = phase a match occurs when qea = 0 bit 7 unimplemented: read as ? 0 ? note 1: when ccm<1:0> = 10 or 11 , all of the qei counters operate as timers and the pimod<2:0> bits are ignored. 2: when ccm<1:0> = 00 and qea and qeb values match index match value (imv), the poscnth and poscntl registers are reset. qea/qeb signals used for index match have swap and polarity values applied, as determined by th e swpab and qeapo l/qebpol bits. 3: the selected clock rate should be at least twice the expected maximum quadrature count rate.
? 2011-2013 microchip technology inc. ds70657g-page 251 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 6-4 intdiv<2:0>: timer input clock prescale select bits (interval timer, main timer (position counter), velocity counter and index counter internal clock divider select) ( 3 ) 111 = 1:128 prescale value 110 = 1:64 prescale value 101 = 1:32 prescale value 100 = 1:16 prescale value 011 = 1:8 prescale value 010 = 1:4 prescale value 001 = 1:2 prescale value 000 = 1:1 prescale value bit 3 cntpol: position and index counter/timer direction select bit 1 = counter direction is negative unless modified by external up/down signal 0 = counter direction is positive unless modified by external up/down signal bit 2 gaten: external count gate enable bit 1 = external gate signal controls position counter operation 0 = external gate signal does not affect position counter/timer operation bit 1-0 ccm<1:0>: counter control mode selection bits 11 = internal timer mode with optional external count is selected 10 = external clock count with optional external count is selected 01 = external clock count with external up/down direction is selected 00 = quadrature encoder interface (x4 mode) count mode is selected register 17-1: qei1con: qei control register (continued) note 1: when ccm<1:0> = 10 or 11 , all of the qei counters operate as timers and the pimod<2:0> bits are ignored. 2: when ccm<1:0> = 00 and qea and qeb values match index match value (imv), the poscnth and poscntl registers are reset. qea/qeb signals used for index match have swap and polarity values applied, as determined by th e swpab and qeapo l/qebpol bits. 3: the selected clock rate should be at least twice the expected maximum quadrature count rate.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 252 ? 2011-2013 microchip technology inc. register 17-2: qei1ioc: qei i/o control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qcapen fltren qfdiv<2:0> outfnc<1:0> swpab bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r-x r-x r-x r-x hompol idxpol qebpol qeapol home index qeb qea bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 qcapen: position counter input capture enable bit 1 = positive edge detect of home input triggers a position capture event 0 = positive edge detect of home input does not trigger a position capture event bit 14 fltren: qeax/qebx/indxx/homex digital filter enable bit 1 = input pin digital filter is enabled 0 = input pin digital filter is disabled (bypassed) bit 13-11 qfdiv<2:0>: qeax/qebx/indxx/homex digital input filter clock divide select bits 111 = 1:128 clock divide 110 = 1:64 clock divide 101 = 1:32 clock divide 100 = 1:16 clock divide 011 = 1:8 clock divide 010 = 1:4 clock divide 001 = 1:2 clock divide 000 = 1:1 clock divide bit 10-9 outfnc<1:0>: qei module output function mode select bits 11 = the ctncmpx pin goes high when qei1lec ? posxcnt ? qei1gec 10 = the ctncmpx pin goes high when posxcnt ? qei1lec 01 = the ctncmpx pin goes high when posxcnt ? qei1gec 00 = output is disabled bit 8 swpab: swap qea and qeb inputs bit 1 = qeax and qebx are swapped prior to quadrature decoder logic 0 = qeax and qebx are not swapped bit 7 hompol: homex input polarity select bit 1 = input is inverted 0 = input is not inverted bit 6 idxpol: indxx input polarity select bit 1 = input is inverted 0 = input is not inverted bit 5 qebpol: qebx input polarity select bit 1 = input is inverted 0 = input is not inverted bit 4 qeapol: qeax input polarity select bit 1 = input is inverted 0 = input is not inverted bit 3 home: status of homex input pin after polarity control 1 = pin is at logic ? 1 ? 0 = pin is at logic ? 0 ?
? 2011-2013 microchip technology inc. ds70657g-page 253 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 2 index: status of indxx input pin after polarity control 1 = pin is at logic ? 1 ? 0 = pin is at logic ? 0 ? bit 1 qeb: status of qebx input pin after pola rity control and swpab pin swapping 1 = pin is at logic ? 1 ? 0 = pin is at logic ? 0 ? bit 0 qea: status of qeax input pin after polarity control and swpab pin swapping 1 = pin is at logic ? 1 ? 0 = pin is at logic ? 0 ? register 17-2: qei1ioc: qei i/o control register (continued)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 254 ? 2011-2013 microchip technology inc. register 17-3: qei1stat: qei status register u-0 u-0 hs, r/c-0 r/w-0 hs, r/c-0 r/w-0 hs, r/c-0 r/w-0 ? ? pcheqirq pcheqien pcleqirq pcleqien posovirq posovien bit 15 bit 8 hs, r/c-0 r/w-0 hs, r/c-0 r/w-0 hs, r/c-0 r/w-0 hs, r/c-0 r/w-0 pciirq ( 1 ) pciien velovirq velovien homirq homien idxirq idxien bit 7 bit 0 legend: hs = hardware settable bit c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 pcheqirq: position counter greater than or equal compare status bit 1 = posxcnt qei1gec 0 = posxcnt < qei1gec bit 12 pcheqien: position counter greater than or equal compare interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 11 pcleqirq: position counter less than or equal compare status bit 1 = posxcnt qei1lec 0 = posxcnt > qei1lec bit 10 pcleqien: position counter less than or equal compare interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 9 posovirq: position counter overflow status bit 1 = overflow has occurred 0 = no overflow has occurred bit 8 posovien: position counter overflow interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 7 pciirq: position counter (homing) initialization process complete status bit ( 1 ) 1 = posxcnt was reinitialized 0 = posxcnt was not reinitialized bit 6 pciien: position counter (homing) initialization process complete interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 5 velovirq: velocity counter overflow status bit 1 = overflow has occurred 0 = no overflow has not occurred bit 4 velovien: velocity counter overflow interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 3 homirq: status flag for home event status bit 1 = home event has occurred 0 = no home event has occurred note 1: this status bit is only applicable to pimod<2:0> modes, ? 011 ? and ? 100 ?.
? 2011-2013 microchip technology inc. ds70657g-page 255 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 2 homien: home input event interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 1 idxirq: status flag for index event status bit 1 = index event has occurred 0 = no index event has occurred bit 0 idxien: index input event interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled register 17-3: qei1stat: qei status register (continued) note 1: this status bit is only applicable to pimod<2:0> modes, ? 011 ? and ? 100 ?.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 256 ? 2011-2013 microchip technology inc. register 17-4: posxcnth: position counter high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poscnt<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poscnt<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 poscnt<31:16>: high word used to form 32-bit position counter register (posxcnt) bits register 17-5: posxcntl: positi on counter low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poscnt<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poscnt<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 poscnt<15:0>: low word used to form 32-bit posi tion counter register (posxcnt) bits register 17-6: posxhld: position counter hold register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poshld<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poshld<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 poshld<15:0>: hold register for reading and writing posxcnth bits
? 2011-2013 microchip technology inc. ds70657g-page 257 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 17-7: velxcnt: velocity counter register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 velcnt<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 velcnt<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 velcnt<15:0>: velocity counter bits register 17-8: indxxcnth: inde x counter high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxcnt<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxcnt<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 indxcnt<31:16>: high word used to form 32-bit index counter register (indxxcnt) bits register 17-9: indxxcntl: index counter low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxcnt<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxcnt<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 indxcnt<15:0>: low word used to form 32-bit index counter register (indxxcnt) bits
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 258 ? 2011-2013 microchip technology inc. register 17-10: indxxhld: in dex counter hold register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxhld<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxhld<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 indxhld<15:0>: hold register for reading and writing indxxcnth bits register 17-11: qei1ich: initialization/capture high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeiic<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeiic<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeiic<31:16>: high word used to form 32-bit initialization/capture register (qei1ic) bits register 17-12: qei1icl: initialization/capture low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeiic<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeiic<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeiic<15:0>: low word used to form 32-bit initialization/capture register (qei1ic) bits
? 2011-2013 microchip technology inc. ds70657g-page 259 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 17-13: qei1lech: less than or equal compare high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeilec<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeilec<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeilec<31:16>: high word used to form 32-bit less than or equal compare register (qei1lec) bits register 17-14: qei1lecl: less than or equal compare low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeilec<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeilec<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeilec<15:0>: low word used to form 32-bit less than or equal compare register (qei1lec) bits
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 260 ? 2011-2013 microchip technology inc. register 17-15: qei1gech: greater than or equal compare high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeigec<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeigec<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeigec<31:16>: high word used to form 32-bit greater than or equal compare register (qei1gec) bits register 17-16: qei1gecl: greater than or equal compare low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeigec<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeigec<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeigec<15:0>: low word used to form 32-bit greater than or equal compare register (qei1gec) bits register 17-17: intxtmrh: interv al timer high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inttmr<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inttmr<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 inttmr<31:16>: high word used to form 32-bit interval timer register (intxtmr) bits
? 2011-2013 microchip technology inc. ds70657g-page 261 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 17-18: intxtmrl: interval timer low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inttmr<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inttmr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 inttmr<15:0>: low word used to form 32-bit interval timer register (intxtmr) bits register 17-19: intxhldh: interval timer hold high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inthld<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inthld<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 inthld<31:16>: hold register for reading and writing intxtmrh bits register 17-20: intxhldl: interv al timer hold low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inthld<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inthld<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 inthld<15:0>: hold register for reading and writing intxtmrl bits
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 262 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 263 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 18.0 serial peripheral interface (spi) the spi module is a synchronous serial interface, useful for communicating with other peripheral or microcontroller devices. these peripheral devices can be serial eeproms, shift registers, display drivers, adc converters, etc. the spi module is compatible with motorola ? spi and siop interfaces. the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x device family offers two spi modules on a single device. these modules, which are designated as spi1 and spi2, are function- ally identical. each spi module includes an eight-word fifo buffer and allows dma bus connections. when using the spi module with dma, fifo operation can be disabled. the spi1 module uses dedicated pins which allow for a higher speed when using spi1. the spi2 module takes advantage of the peripheral pin select (pps) feature to allow for greater flexibility in pin configuration of the spi2 module, but results in a lower maximum speed for spi2. see section 30.0 ?electrical characteristics? for more information. the spix serial interface consists of four pins, as follows: ? sdix: serial data input ? sdox: serial data output ? sckx: shift clock input or output ? ssx /fsyncx: active-low slave select or frame synchronization i/o pulse the spix module can be configured to operate with two, three or four pins. in 3-pin mode, ssx is not used. in 2-pin mode, neither sdox nor ssx is used. figure 18-1 illustrates the block diagram of the spix module in standard and enhanced modes. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to section 18. ?serial peripheral interface (spi)? (ds70569) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: in this section, the spi modules are referred to together as spix, or separately as spi1 and spi2. special function registers follow a similar notation. for example, spixcon refers to the control register for the spi1 and spi2 module.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 264 ? 2011-2013 microchip technology inc. figure 18-1: spix module block diagram internal data bus sdix sdox ssx /fsyncx sckx bit 0 shift control edge select f p primary 1:1/4/16/64 enable prescaler sync control transfer transfer write spixbuf read spixbuf 16 spixcon1<1:0> spixcon1<4:2> master clock note 1: in standard mode, the fifo is only one level deep. clock control secondary prescaler 1:1 to 1:8 spixsr 8-level fifo receive buffer (1) 8-level fifo transmit buffer (1) spixbuf
? 2011-2013 microchip technology inc. ds70657g-page 265 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 18.1 spi helpful tips 1. in frame mode, if there is a possibility that the master may not be initialized before the slave: a) if frmpol (spixcon2<13>) = 1 , use a pull-down resistor on ssx . b) if frmpol = 0 , use a pull-up resistor on ssx . 2. in non-framed 3-wire mode, (i.e., not using ssx from a master): a) if ckp (spixcon1<6>) = 1 , always place a pull-up resistor on ssx . b) if ckp = 0 , always place a pull-down resistor on ssx . 3. frmen (spixcon2<15>) = 1 and ssen (spixcon1<7>) = 1 are exclusive and invalid. in frame mode, sckx is continuous and the frame sync pulse is active on the ssx pin, which indicates the start of a data frame. 4. in master mode only, set the smp bit (spixcon1<9>) to a ? 1 ? for the fastest spix data rate possible. the smp bit can only be set at the same time or after the msten bit (spixcon1<5>) is set. to avoid invalid slave read data to the master, the user?s master software must ensure enough time for slave software to fill its write buffer before the user application initiates a master write/read cycle. it is always advisable to preload the spixbuf transmit register in advance of the next master transaction cycle. spixbuf is transferred to the spix shift register and is empty once the data transmission begins. 18.2 spi resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 18.2.1 key resources ? section 18. ?serial peripheral interface (spi)? (ds70569) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: this insures that the first frame transmission after initialization is not shifted or corrupted. note: this will insure that during power-up and initialization the master/slave will not lose sync due to an errant sckx transition that would cause the slave to accumulate data shift errors for both transmit and receive appearing as corrupted data. note: not all third-party devices support frame mode timing. refer to the spix specifications in section 30.0 ?electrical characteristics? for details. note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 266 ? 2011-2013 microchip technology inc. 18.3 spix control registers register 18-1: spixstat: spix status and control register r/w-0 u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 spien ? spisidl ? ? spibec<2:0> bit 15 bit 8 r/w-0 r/c-0, hs r/w-0 r/w-0 r/w-0 r/w-0 r-0, hs, hc r-0, hs, hc srmpt spirov srxmpt sisel<2:0> spitbf spirbf bit 7 bit 0 legend: c = clearable bit hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 spien: spix enable bit 1 = enables the module and configures sckx, sdox, sdix and ssx as serial port pins 0 = disables the module bit 14 unimplemented: read as ? 0 ? bit 13 spisidl: spix stop in idle mode bit 1 = discontinues the module operation when device enters idle mode 0 = continues the module operation in idle mode bit 12-11 unimplemented: read as ? 0 ? bit 10-8 spibec<2:0>: spix buffer element count bits (valid in enhanced buffer mode) master mode: number of spix transfers that are pending. slave mode: number of spix transfers that are unread. bit 7 srmpt: spix shift register (spixsr) empty bit (valid in enhanced buffer mode) 1 = spix shift register is empty and ready to send or receive the data 0 = spix shift register is not empty bit 6 spirov: spix receive overflow flag bit 1 = a new byte/word is completely received and discarded; the user application has not read the previous data in the spixbuf register 0 = no overflow has occurred bit 5 srxmpt: spix receive fifo empty bit (valid in enhanced buffer mode) 1 = rx fifo is empty 0 = rx fifo is not empty bit 4-2 sisel<2:0>: spix buffer interrupt mode bits (valid in enhanced buffer mode) 111 = interrupt when the spix transmit buffer is full (spitbf bit is set) 110 = interrupt when last bit is shifted into spixsr and as a result, the tx fifo is empty 101 = interrupt when the last bit is shifted out of spixsr and the transmit is complete 100 = interrupt when one data is shifted into the spixsr and as a result, the tx fifo has one open memory location 011 = interrupt when the spix receive buffer is full (spirbf bit is set) 010 = interrupt when the spix receive buffer is 3/4 or more full 001 = interrupt when data is available in the receive buffer (srmpt bit is set) 000 = interrupt when the last data in the receive buffer is read and as a result, the buffer is empty (srxmpt bit set)
? 2011-2013 microchip technology inc. ds70657g-page 267 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 1 spitbf: spix transmit buffer full status bit 1 = transmit not yet started, spixtxb is full 0 = transmit started, spixtxb is empty standard buffer mode: automatically set in hardware when core writes to the spixbuf location, loading spixtxb. automatically cleared in hardware when spix module transfers data from spixtxb to spixsr. enhanced buffer mode: automatically set in hardware when the cpu writes to the spixbuf location, loading the last available buffer location. automatically cleared in hardware when a buffer location is available for a cpu write operation. bit 0 spirbf: spix receive buffer full status bit 1 = receive is complete, spixrxb is full 0 = receive is incomplete, spixrxb is empty standard buffer mode: automatically set in hardware when spix transfers data from spixsr to spixrxb. automatically cleared in hardware when the core reads the spixbuf location, reading spixrxb. enhanced buffer mode: automatically set in hardware when spix transfers data from spixsr to the buffer, filling the last unread buffer location. automatically cleared in hardware when a buffer location is available for a transfer from spixsr. register 18-1: spixstat: spix status and control register (continued)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 268 ? 2011-2013 microchip technology inc. register 18-2: spi x con1: spi x control register 1 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? dissck dissdo mode16 smp cke ( 1 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ssen ( 2 ) ckp msten spre<2:0> ( 3 ) ppre<1:0> ( 3 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12 dissck: disable sckx pin bit (spix master modes only) 1 = internal spix clock is disabled, pin functions as i/o 0 = internal spix clock is enabled bit 11 dissdo: disable sdox pin bit 1 = sdox pin is not used by the module; pin functions as i/o 0 = sdox pin is controlled by the module bit 10 mode16: word/byte communication select bit 1 = communication is word-wide (16 bits) 0 = communication is byte-wide (8 bits) bit 9 smp: spix data input sample phase bit master mode: 1 = input data is sampled at end of data output time 0 = input data is sampled at middle of data output time slave mode: smp must be cleared when spix is used in slave mode. bit 8 cke: spix clock edge select bit ( 1 ) 1 = serial output data changes on transition from active clock state to idle clock state (refer to bit 6) 0 = serial output data changes on transition from idle clock state to active clock state (refer to bit 6) bit 7 ssen: slave select enable bit (slave mode) ( 2 ) 1 = ssx pin is used for slave mode 0 = ssx pin is not used by the module; pin is controlled by port function bit 6 ckp: clock polarity select bit 1 = idle state for clock is a high level; active state is a low level 0 = idle state for clock is a low level; active state is a high level bit 5 msten: master mode enable bit 1 = master mode 0 = slave mode note 1: the cke bit is not used in framed spi modes. program this bit to ? 0 ? for framed spi modes (frmen = 1 ). 2: this bit must be cleared when frmen = 1 . 3: do not set both primary and secondary prescalers to the value of 1:1.
? 2011-2013 microchip technology inc. ds70657g-page 269 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 4-2 spre<2:0>: secondary prescale bits (master mode) ( 3 ) 111 = secondary prescale 1:1 110 = secondary prescale 2:1 ? ? ? 000 = secondary prescale 8:1 bit 1-0 ppre<1:0>: primary prescale bits (master mode) ( 3 ) 11 = primary prescale 1:1 10 = primary prescale 4:1 01 = primary prescale 16:1 00 = primary prescale 64:1 register 18-2: spi x con1: spi x control register 1 (continued) note 1: the cke bit is not used in framed spi modes. program this bit to ? 0 ? for framed spi modes (frmen = 1 ). 2: this bit must be cleared when frmen = 1 . 3: do not set both primary and secondary prescalers to the value of 1:1.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 270 ? 2011-2013 microchip technology inc. register 18-3: spi x con2: spi x control register 2 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 frmen spifsd frmpol ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 ? ? ? ? ? ? frmdly spiben bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 frmen: framed spix support bit 1 = framed spix support is enabled (ssx pin is used as frame sync pulse input/output) 0 = framed spix support is disabled bit 14 spifsd: frame sync pulse direction control bit 1 = frame sync pulse input (slave) 0 = frame sync pulse output (master) bit 13 frmpol: frame sync pulse polarity bit 1 = frame sync pulse is active-high 0 = frame sync pulse is active-low bit 12-2 unimplemented: read as ? 0 ? bit 1 frmdly: frame sync pulse edge select bit 1 = frame sync pulse coincides with first bit clock 0 = frame sync pulse precedes first bit clock bit 0 spiben: enhanced buffer enable bit 1 = enhanced buffer is enabled 0 = enhanced buffer is disabled (standard mode)
? 2011-2013 microchip technology inc. ds70657g-page 271 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 19.0 inter-integrated circuit? (i 2 c?) the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x family of devices contains two inter-integrated circuit (i 2 c) modules: i2c1 and i2c2. the i 2 c module provides complete hardware support for both slave and multi-master modes of the i 2 c serial communication standard, with a 16-bit interface. the i 2 c module has a 2-pin interface: ? the sclx pin is clock ? the sdax pin is data the i 2 c module offers the following key features: ?i 2 c interface supporting both master and slave modes of operation ?i 2 c slave mode supports 7 and 10-bit addressing ?i 2 c master mode supports 7 and 10-bit addressing ?i 2 c port allows bidirectional transfers between master and slaves ? serial clock synchronization for i 2 c port can be used as a handshake mechanism to suspend and resume serial transfer (sclrel control) ?i 2 c supports multi-master operation, detects bus collision and arbitrates accordingly ? intelligent platform management interface (ipmi) support ? system management bus (smbus) support note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to section 19. ?inter-integrated circuit? (i 2 c?)? (ds70330) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 272 ? 2011-2013 microchip technology inc. figure 19-1: i2cx block diagram ( x = 1 or 2) internal data bus sclx/asclx sdax/asdax shift match detect start and stop bit detect clock address match clock stretching i2cxtrn lsb shift clock brg down counter reload control f p /2 start and stop bit generation acknowledge generation collision detect i2cxcon i2cxstat control logic read lsb write read i2cxbrg i2cxrsr write read write read write read write read write read i2cxmsk i2cxrcv i2cxadd
? 2011-2013 microchip technology inc. ds70657g-page 273 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 19.1 i 2 c resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 19.1.1 key resources ? section 19. ?inter-integrated circuit (i 2 c)? (ds70330) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 274 ? 2011-2013 microchip technology inc. 19.2 i 2 c control registers register 19-1: i2cxcon: i2cx control register r/w-0 u-0 r/w-0 r/w-1, hc r/w-0 r/w-0 r/w-0 r/w-0 i2cen ? i2csidl sclrel ipmien ( 1 ) a10m disslw smen bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0, hc r/w-0, hc r/w-0, hc r/w-0, hc r/w-0, hc gcen stren ackdt acken rcen pen rsen sen bit 7 bit 0 legend: hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 i2cen: i2cx enable bit 1 = enables the i2cx module and configures the sdax and sclx pins as serial port pins 0 = disables the i2cx module; all i 2 c? pins are controlled by port functions bit 14 unimplemented: read as ? 0 ? bit 13 i2csidl: i2cx stop in idle mode bit 1 = discontinues module operation when device enters an idle mode 0 = continues module operation in idle mode bit 12 sclrel: sclx release control bit (when operating as i 2 c slave) 1 = releases sclx clock 0 = holds sclx clock low (clock stretch) if stren = 1 : bit is r/w (i.e., software can write ? 0 ? to initiate stretch and write ? 1 ? to release clock). hardware is clear at the beginning of every slave data byte transmission. hardware is clear at the end of every slave address byte reception. hardware is clear at the end of every slave data byte reception. if stren = 0 : bit is r/s (i.e., software can only write ? 1 ? to release clock). hardware is clear at the beginning of every slave data byte transmission. hardware is clear at the end of every slave address byte reception. bit 11 ipmien: intelligent peripheral management interface (ipmi) enable bit ( 1 ) 1 = ipmi mode is enabled; all addresses are acknowledged 0 = ipmi mode disabled bit 10 a10m: 10-bit slave address bit 1 = i2cxadd is a 10-bit slave address 0 = i2cxadd is a 7-bit slave address bit 9 disslw: disable slew rate control bit 1 = slew rate control is disabled 0 = slew rate control is enabled bit 8 smen: smbus input levels bit 1 = enables i/o pin thresholds compliant with smbus specification 0 = disables smbus input thresholds bit 7 gcen: general call enable bit (when operating as i 2 c slave) 1 = enables interrupt when a general call address is received in i2cxrsr (module is enabled for reception) 0 = general call address disabled note 1: when performing master operations, ensure that the ipmien bit is set to ? 0 ?.
? 2011-2013 microchip technology inc. ds70657g-page 275 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 6 stren: sclx clock stretch enable bit (when operating as i 2 c slave) used in conjunction with the sclrel bit. 1 = enables software or receives clock stretching 0 = disables software or receives clock stretching bit 5 ackdt: acknowledge data bit (when operating as i 2 c master, applicable during master receive) value that is transmitted when the software initiates an acknowledge sequence. 1 = sends nack during acknowledge 0 = sends ack during acknowledge bit 4 acken: acknowledge sequence enable bit (when operating as i 2 c master, applicable during master receive) 1 = initiates acknowledge sequence on sdax and sclx pins and transmits ackdt data bit. hardware is clear at the end of the master acknowledge sequence. 0 = acknowledge sequence is not in progress bit 3 rcen: receive enable bit (when operating as i 2 c master) 1 = enables receive mode for i 2 c. hardware is clear at the end of the eighth bit of the master receive data byte. 0 = receive sequence is not in progress bit 2 pen: stop condition enable bit (when operating as i 2 c master) 1 = initiates stop condition on sdax and sclx pins. hardware is clear at the end of the master stop sequence. 0 = stop condition is not in progress bit 1 rsen: repeated start condition enable bit (when operating as i 2 c master) 1 = initiates repeated start condition on sdax and sclx pins. hardware is clear at the end of the master repeated start sequence. 0 = repeated start condition is not in progress bit 0 sen: start condition enable bit (when operating as i 2 c master) 1 = initiates start condition on sdax and sclx pins. hardware is clear at the end of the master start sequence. 0 = start condition is not in progress register 19-1: i2cxcon: i2cx control register (continued) note 1: when performing master operations, ensure that the ipmien bit is set to ? 0 ?.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 276 ? 2011-2013 microchip technology inc. register 19-2: i2cxstat: i2cx status register r-0, hsc r-0, hsc u-0 u-0 u-0 r/c-0, hs r-0, hsc r-0, hsc ackstat trstat ? ? ? bcl gcstat add10 bit 15 bit 8 r/c-0, hs r/c-0, hs r-0, hsc r/c-0, hsc r/c-0, hsc r-0, hsc r-0, hsc r-0, hsc iwcol i2cov d_a p s r_w rbf tbf bit 7 bit 0 legend: c = clearable bit hs = hardware settable bit hsc = hardware settable/clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ackstat: acknowledge status bit (when operating as i 2 c? master, applicable to master transmit operation) 1 = nack received from slave 0 = ack received from slave hardware is set or clear at the end of slave acknowledge. bit 14 trstat: transmit status bit (when operating as i 2 c master, applicable to master transmit operation) 1 = master transmit is in progress (8 bits + ack) 0 = master transmit is not in progress hardware is set at the beginning of master transmission. hardware is clear at the end of slave acknowledge. bit 13-11 unimplemented: read as ? 0 ? bit 10 bcl: master bus collision detect bit 1 = a bus collision has been detected during a master operation 0 = no bus collision detected hardware is set at detection of a bus collision. bit 9 gcstat: general call status bit 1 = general call address was received 0 = general call address was not received hardware is set when address matches general call address. hardware is clear at stop detection. bit 8 add10: 10-bit address status bit 1 = 10-bit address was matched 0 = 10-bit address was not matched hardware is set at the match of the 2nd byte of the matched 10-bit address. hardware is clear at stop detection. bit 7 iwcol: i2cx write collision detect bit 1 = an attempt to write to the i2cxtrn register failed because the i 2 c module is busy 0 = no collision hardware is set at the occurrence of a write to i2cxtrn while busy (cleared by software). bit 6 i2cov: i2cx receive overflow flag bit 1 = a byte was received while the i2cxrcv register was still holding the previous byte 0 = no overflow hardware is set at an attempt to transfer i2cxrsr to i2cxrcv (cleared by software). bit 5 d_a: data/address bit (when operating as i 2 c slave) 1 = indicates that the last byte received was data 0 = indicates that the last byte received was a device address hardware is clear at a device address match. hardware is set by reception of a slave byte. bit 4 p: stop bit 1 = indicates that a stop bit has been detected last 0 = stop bit was not detected last hardware is set or clear when a start, repeated start or stop is detected.
? 2011-2013 microchip technology inc. ds70657g-page 277 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 3 s: start bit 1 = indicates that a start (or repeated start) bit has been detected last 0 = start bit was not detected last hardware is set or clear when a start, repeated start or stop is detected. bit 2 r_w: read/write information bit (when operating as i 2 c slave) 1 = read ? indicates data transfer is output from the slave 0 = write ? indicates data transfer is input to the slave hardware is set or clear after reception of an i 2 c device address byte. bit 1 rbf: receive buffer full status bit 1 = receive is complete, i2cxrcv is full 0 = receive is not complete, i2cxrcv is empty hardware is set when i2cxrcv is written with a received byte. hardware is clear when software reads i2cxrcv. bit 0 tbf: transmit buffer full status bit 1 = transmit in progress, i2cxtrn is full 0 = transmit is complete, i2cxtrn is empty hardware is set when software writes to i2cxtrn. hardware is clear at completion of a data transmission. register 19-2: i2cxstat: i2cx status register (continued)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 278 ? 2011-2013 microchip technology inc. register 19-3: i2cxmsk: i2cx sl ave mode address mask register u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 ? ? ? ? ? ? amsk9 amsk8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 amsk7 amsk6 amsk5 amsk4 amsk3 amsk2 amsk1 amsk0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 unimplemented: read as ? 0 ? bit 9-0 amsk<9:0>: address mask select bits for 10-bit address: 1 = enables masking for bit ax of incoming message address; bit match is not required in this position 0 = disables masking for bit ax; bit match is required in this position for 7-bit address (i2cxmsk<6:0> only): 1 = enables masking for bit ax + 1 of incoming message address; bit match is not required in this position 0 = disables masking for bit ax + 1; bit match is required in this position
? 2011-2013 microchip technology inc. ds70657g-page 279 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 20.0 universal asynchronous receiver transmitter (uart) the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x family of devices contains two uart modules. the universal asynchronous receiver transmitter (uart) module is one of the serial i/o modules available in the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/ mc20x device family. the uart is a full-duplex asynchronous system that can communicate with peripheral devices, such as personal computers, lin/ j2602, rs-232 and rs-485 interfaces. the module also supports a hardware flow control option with the uxcts and uxrts pins, and also includes an irda ? encoder and decoder. the primary features of the uartx module are: ? full-duplex, 8 or 9-bit data transmission through the uxtx and uxrx pins ? even, odd or no parity options (for 8-bit data) ? one or two stop bits ? hardware flow control option with uxcts and uxrts pins ? fully integrated baud rate generator with 16-bit prescaler ? baud rates ranging from 4.375 mbps to 67 bps at 16x mode at 70 mips ? baud rates ranging from 17.5 mbps to 267 bps at 4x mode at 70 mips ? 4-deep first-in first-out (fifo) transmit data buffer ? 4-deep fifo receive data buffer ? parity, framing and buffer overrun error detection ? support for 9-bit mode with address detect (9th bit = 1 ) ? transmit and receive interrupts ? a separate interrupt for all uartx error conditions ? loopback mode for diagnostic support ? support for sync and break characters figure 20-1: uartx simp lified block diagram note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to section 17. ?uart? (ds70582) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: hardware flow control using uxrts and uxcts is not available on all pin count devices. see the ?pin diagrams? section for availability. uxrx hardware flow control uartx receiver uartx transmitter uxtx baud rate generator uxrts /bclkx uxcts irda ?
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 280 ? 2011-2013 microchip technology inc. 20.1 uart helpful tips 1. in multi-node, direct-connect uart networks, uart receive inputs react to the complementary logic level defined by the urxinv bit (uxmode<4>), which defines the idle state, the default of which is logic high (i.e., urxinv = 0 ). because remote devices do not initialize at the same time, it is likely that one of the devices, because the rx line is floating, will trigger a start bit detection and will cause the first byte received, after the device has been ini- tialized, to be invalid. to avoid this situation, the user should use a pull-up or pull-down resistor on the rx pin depending on the value of the urxinv bit. a) if urxinv = 0 , use a pull-up resistor on the rx pin. b) if urxinv = 1 , use a pull-down resistor on the rx pin. 2. the first character received on a wake-up from sleep mode caused by activity on the uxrx pin of the uartx module will be invalid. in sleep mode, peripheral clocks are disabled. by the time the oscillator system has restarted and stabilized from sleep mode, the baud rate bit sampling clock, relative to the incoming uxrx bit timing, is no longer synchronized, resulting in the first character being invalid; this is to be expected. 20.2 uart resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 20.2.1 key resources ? section 17. ?uart? (ds70582) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 281 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 20.3 uartx control registers register 20-1: uxmode: uart x mode register r/w-0 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 uarten ( 1 ) ? usidl iren ( 2 ) rtsmd ?uen<1:0> bit 15 bit 8 r/w-0, hc r/w-0 r/w-0, hc r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 wake lpback abaud urxinv brgh pdsel<1:0> stsel bit 7 bit 0 legend: hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 uarten: uartx enable bit ( 1 ) 1 = uartx is enabled; all uartx pins are controlled by uartx as defined by uen<1:0> 0 = uartx is disabled; all uartx pins are controlled by port latches; uartx power consumption is minimal bit 14 unimplemented: read as ? 0 ? bit 13 usidl: uartx stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12 iren: irda ? encoder and decoder enable bit ( 2 ) 1 = irda encoder and decoder are enabled 0 = irda encoder and decoder are disabled bit 11 rtsmd: mode selection for uxrts pin bit 1 =uxrts pin is in simplex mode 0 =uxrts pin is in flow control mode bit 10 unimplemented: read as ? 0 ? bit 9-8 uen<1:0>: uartx pin enable bits 11 = uxtx, uxrx and bclkx pins are enabled and used; uxcts pin is controlled by port latches ( 3 ) 10 = uxtx, uxrx, uxcts and uxrts pins are enabled and used ( 4 ) 01 = uxtx, uxrx and uxrts pins are enabled and used; uxcts pin is controlled by port latches ( 4 ) 00 = uxtx and uxrx pins are enabled and used; uxcts and uxrts /bclkx pins are controlled by port latches bit 7 wake: wake-up on start bit detect during sleep mode enable bit 1 = uartx continues to sample the uxrx pin; interrupt is generated on the falling edge; bit is cleared in hardware on the following rising edge 0 = no wake-up is enabled bit 6 lpback: uartx loopback mode select bit 1 = enables loopback mode 0 = loopback mode is disabled note 1: refer to section 17. ?uart? (ds70582) in the ?dspic33e/pic24e family reference manual? for information on enabling the uartx module for receive or transmit operation. 2: this feature is only available for the 16x brg mode (brgh = 0 ). 3: this feature is only available on 44-pin and 64-pin devices. 4: this feature is only available on 64-pin devices.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 282 ? 2011-2013 microchip technology inc. bit 5 abaud: auto-baud enable bit 1 = enables baud rate measurement on the next character ? requires reception of a sync field (55h) before other data; cleared in hardware upon completion 0 = baud rate measurement is disabled or completed bit 4 urxinv: uartx receive polarity inversion bit 1 = uxrx idle state is ? 0 ? 0 = uxrx idle state is ? 1 ? bit 3 brgh: high baud rate enable bit 1 = brg generates 4 clocks per bit period (4x baud clock, high-speed mode) 0 = brg generates 16 clocks per bit period (16x baud clock, standard mode) bit 2-1 pdsel<1:0>: parity and data selection bits 11 = 9-bit data, no parity 10 = 8-bit data, odd parity 01 = 8-bit data, even parity 00 = 8-bit data, no parity bit 0 stsel: stop bit selection bit 1 = two stop bits 0 = one stop bit register 20-1: uxmode: uart x mode register (continued) note 1: refer to section 17. ?uart? (ds70582) in the ?dspic33e/pic24e family reference manual? for information on enabling the uartx module for receive or transmit operation. 2: this feature is only available for the 16x brg mode (brgh = 0 ). 3: this feature is only available on 44-pin and 64-pin devices. 4: this feature is only available on 64-pin devices.
? 2011-2013 microchip technology inc. ds70657g-page 283 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 20-2: u x sta: uart x status and control register r/w-0 r/w-0 r/w-0 u-0 r/w-0, hc r/w-0 r-0 r-1 utxisel1 utxinv utxisel0 ? utxbrk utxen ( 1 ) utxbf trmt bit 15 bit 8 r/w-0 r/w-0 r/w-0 r-1 r-0 r-0 r/c-0 r-0 urxisel<1:0> adden ridle perr ferr oerr urxda bit 7 bit 0 legend: hc = hardware clearable bit c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15,13 utxisel<1:0>: uartx transmission interrupt mode selection bits 11 = reserved; do not use 10 = interrupt when a character is transferred to the transmit shift register (tsr) and as a result, the transmit buffer becomes empty 01 = interrupt when the last character is shifted out of the transmit shift register; all transmit operations are completed 00 = interrupt when a character is transferred to the tr ansmit shift register (this implies there is at least one character open in the transmit buffer) bit 14 utxinv: uartx transmit polarity inversion bit if iren = 0 : 1 = uxtx idle state is ? 0 ? 0 = uxtx idle state is ? 1 ? if iren = 1 : 1 = irda encoded, uxtx idle state is ? 1 ? 0 = irda encoded, uxtx idle state is ? 0 ? bit 12 unimplemented: read as ? 0 ? bit 11 utxbrk: uartx transmit break bit 1 = sends sync break on next transmission ? start bit, followed by twelve ? 0 ? bits, followed by stop bit; cleared by hardware upon completion 0 = sync break transmission is disabled or completed bit 10 utxen: uartx transmit enable bit ( 1 ) 1 = transmit is enabled, uxtx pin is controlled by uartx 0 = transmit is disabled, any pending transmission is aborted and buffer is reset; uxtx pin is controlled by the port bit 9 utxbf: uartx transmit buffer full status bit (read-only) 1 = transmit buffer is full 0 = transmit buffer is not full, at least one more character can be written bit 8 trmt: transmit shift register empty bit (read-only) 1 = transmit shift register is empty and transmit buffer is empty (the last transmission has completed) 0 = transmit shift register is not empty, a transmission is in progress or queued bit 7-6 urxisel<1:0>: uartx receive interrupt mode selection bits 11 = interrupt is set on uxrsr transfer, making the receive buffer full (i.e., has 4 data characters) 10 = interrupt is set on uxrsr transfer, making the receive buffer 3/4 full (i.e., has 3 data characters) 0x = interrupt is set when any character is received and transferred from the uxrsr to the receive buffer; receive buffer has one or more characters note 1: refer to section 17. ?uart? (ds70582) in the ?dspic33e/pic24e family reference manual? for information on enabling the uartx module for transmit operation.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 284 ? 2011-2013 microchip technology inc. bit 5 adden: address character detect bit (bit 8 of received data = 1 ) 1 = address detect mode is enabled; if 9-bit mode is not selected, this does not take effect 0 = address detect mode is disabled bit 4 ridle: receiver idle bit (read-only) 1 = receiver is idle 0 = receiver is active bit 3 perr: parity error status bit (read-only) 1 = parity error has been detected for the current character (character at the top of the receive fifo) 0 = parity error has not been detected bit 2 ferr: framing error status bit (read-only) 1 = framing error has been detected for the current character (character at the top of the receive fifo) 0 = framing error has not been detected bit 1 oerr: receive buffer overrun error status bit (clear/read-only) 1 = receive buffer has overflowed 0 = receive buffer has not overflowed; clearing a previously set oerr bit ( 1 ? 0 transition) resets the receiver buffer and the uxrsr to the empty state bit 0 urxda: uartx receive buffer data available bit (read-only) 1 = receive buffer has data, at least one more character can be read 0 = receive buffer is empty register 20-2: u x sta: uart x status and control register (continued) note 1: refer to section 17. ?uart? (ds70582) in the ?dspic33e/pic24e family reference manual? for information on enabling the uartx module for transmit operation.
? 2011-2013 microchip technology inc. ds70657g-page 285 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 21.0 enhanced can (ecan?) module (dspic33epxxxgp/ mc50x devices only) 21.1 overview the enhanced controller area network (ecan) module is a serial interface, useful for communicat- ing with other can modules or microcontroller devices. this interface/protocol was designed to allow communications within noisy environments. the dspic33epxxxgp/mc50x devices contain one ecan module. the ecan module is a communication controller implementing the can 2.0 a/b protocol, as defined in the bosch can specification. the module supports can 1.2, can 2.0a, can 2.0b passive and can 2.0b active versions of the protocol. the module implemen- tation is a full can system. the can specification is not covered within this data sheet. the reader can refer to the bosch can specification for further details. the ecan module features are as follows: ? implementation of the can protocol, can 1.2, can2.0a and can2.0b ? standard and extended data frames ? 0-8 bytes data length ? programmable bit rate up to 1 mbit/sec ? automatic response to remote transmission requests ? up to eight transmit buffers with application speci- fied prioritization and abort capability (each buffer can contain up to 8 bytes of data) ? up to 32 receive buffers (each buffer can contain up to 8 bytes of data) ? up to 16 full (standard/extended identifier) acceptance filters ? three full acceptance filter masks ? devicenet? addressing support ? programmable wake-up functionality with integrated low-pass filter ? programmable loopback mode supports self-test operation ? signaling via interrupt capabilities for all can receiver and transmitter error states ? programmable clock source ? programmable link to input capture (ic2) module for time-stamping and network synchronization ? low-power sleep and idle mode the can bus module consists of a protocol engine and message buffering/control. the can protocol engine handles all functions for receiving and transmitting messages on the can bus. messages are transmitted by first loading the appropriate data registers. status and errors can be checked by reading the appropriate registers. any message detected on the can bus is checked for errors and then matched against filters to see if it should be received and stored in one of the receive registers. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 21. ?enhanced controller area network (ecan?)? (ds70353) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 286 ? 2011-2013 microchip technology inc. figure 21-1: ecan? mo dule block diagram message assembly can protocol engine cxtx buffer cxrx rxf14 filter rxf13 filter rxf12 filter rxf11 filter rxf10 filter rxf9 filter rxf8 filter rxf7 filter rxf6 filter rxf5 filter rxf4 filter rxf3 filter rxf2 filter rxf1 filter rxf0 filter transmit byte sequencer rxm1 mask rxm0 mask control configuration logic cpu bus interrupts trb0 tx/rx buffer control register rxf15 filter rxm2 mask trb7 tx/rx buffer control register trb6 tx/rx buffer control register trb5 tx/rx buffer control register trb4 tx/rx buffer control register trb3 tx/rx buffer control register trb2 tx/rx buffer control register trb1 tx/rx buffer control register dma controller
? 2011-2013 microchip technology inc. ds70657g-page 287 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 21.2 modes of operation the ecan module can operate in one of several operation modes selected by the user. these modes include: ? initialization mode ? disable mode ? normal operation mode ? listen only mode ? listen all messages mode ? loopback mode modes are requested by setting the reqop<2:0> bits (cxctrl1<10:8>). entry into a mode is acknowledged by monitoring the opmode<2:0> bits (cxctrl1<7:5>). the module does not change the mode and the opmodex bits until a change in mode is acceptable, generally during bus idle time, which is defined as at least 11 consecutive recessive bits. 21.3 ecan resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 21.3.1 key resources ? section 21. ?enhanced controller area network (ecan?)? (ds70353) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 288 ? 2011-2013 microchip technology inc. 21.4 ecan control registers register 21-1: cxctrl1: e canx control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-0 r/w-0 ? ? csidl abat cancks reqop<2:0> bit 15 bit 8 r-1 r-0 r-0 u-0 r/w-0 u-0 u-0 r/w-0 opmode<2:0> ? cancap ? ?win bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 csidl: ecan stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12 abat: abort all pending transmissions bit 1 = signals all transmit buffers to abort transmission 0 = module will clear this bit when all transmissions are aborted bit 11 cancks: ecan module clock (f can ) source select bit 1 = f can is equal to 2 * f p 0 = f can is equal to f p bit 10-8 reqop<2:0>: request operation mode bits 111 = set listen all messages mode 110 = reserved 101 = reserved 100 = set configuration mode 011 = set listen only mode 010 = set loopback mode 001 = set disable mode 000 = set normal operation mode bit 7-5 opmode<2:0> : operation mode bits 111 = module is in listen all messages mode 110 = reserved 101 = reserved 100 = module is in configuration mode 011 = module is in listen only mode 010 = module is in loopback mode 001 = module is in disable mode 000 = module is in normal operation mode bit 4 unimplemented: read as ? 0 ? bit 3 cancap: can message receive timer capture event enable bit 1 = enables input capture based on can message receive 0 = disables can capture bit 2-1 unimplemented: read as ? 0 ? bit 0 win: sfr map window select bit 1 = uses filter window 0 = uses buffer window
? 2011-2013 microchip technology inc. ds70657g-page 289 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-2: cxctrl2: e canx control register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r-0 r-0 r-0 r-0 r-0 ? ? ? dncnt<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 unimplemented: read as ? 0 ? bit 4-0 dncnt<4:0>: devicenet? filter bit number bits 10010-11111 = invalid selection 10001 = compares up to data byte 3, bit 6 with eid<17> ? ? ? 00001 = compares up to data byte 1, bit 7 with eid<0> 00000 = does not compare data bytes
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 290 ? 2011-2013 microchip technology inc. register 21-3: cxvec: ecanx interrupt code register u-0 u-0 u-0 r-0 r-0 r-0 r-0 r-0 ? ? ?filhit<4:0> bit 15 bit 8 u-0 r-1 r-0 r-0 r-0 r-0 r-0 r-0 ? icode<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-8 filhit<4:0>: filter hit number bits 10000-11111 = reserved 01111 = filter 15 ? ? ? 00001 = filter 1 00000 = filter 0 bit 7 unimplemented: read as ? 0 ? bit 6-0 icode<6:0>: interrupt flag code bits 1000101-1111111 = reserved 1000100 = fifo almost full interrupt 1000011 = receiver overflow interrupt 1000010 = wake-up interrupt 1000001 = error interrupt 1000000 = no interrupt ? ? ? 0010000-0111111 = reserved 0001111 = rb15 buffer interrupt ? ? ? 0001001 = rb9 buffer interrupt 0001000 = rb8 buffer interrupt 0000111 = trb7 buffer interrupt 0000110 = trb6 buffer interrupt 0000101 = trb5 buffer interrupt 0000100 = trb4 buffer interrupt 0000011 = trb3 buffer interrupt 0000010 = trb2 buffer interrupt 0000001 = trb1 buffer interrupt 0000000 = trb0 buffer interrupt
? 2011-2013 microchip technology inc. ds70657g-page 291 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-4: cxfctrl: ecanx fifo control register r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 dmabs<2:0> ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? fsa<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 dmabs<2:0>: dma buffer size bits 111 = reserved 110 = 32 buffers in ram 101 = 24 buffers in ram 100 = 16 buffers in ram 011 = 12 buffers in ram 010 = 8 buffers in ram 001 = 6 buffers in ram 000 = 4 buffers in ram bit 12-5 unimplemented: read as ? 0 ? bit 4-0 fsa<4:0>: fifo area starts with buffer bits 11111 = read buffer rb31 11110 = read buffer rb30 ? ? ? 00001 = tx/rx buffer trb1 00000 = tx/rx buffer trb0
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 292 ? 2011-2013 microchip technology inc. register 21-5: cxfifo: ecanx fifo status register u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? fbp<5:0> bit 15 bit 8 u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? fnrb<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 fbp<5:0>: fifo buffer pointer bits 011111 = rb31 buffer 011110 = rb30 buffer ? ? ? 000001 = trb1 buffer 000000 = trb0 buffer bit 7-6 unimplemented: read as ? 0 ? bit 5-0 fnrb<5:0>: fifo next read buffer pointer bits 011111 = rb31 buffer 011110 = rb30 buffer ? ? ? 000001 = trb1 buffer 000000 = trb0 buffer
? 2011-2013 microchip technology inc. ds70657g-page 293 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-6: cxintf: ecanx interrupt flag register u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? txbo txbp rxbp txwar rxwar ewarn bit 15 bit 8 r/c-0 r/c-0 r/c-0 u-0 r/c-0 r/c-0 r/c-0 r/c-0 ivrif wakif errif ? fifoif rbovif rbif tbif bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 txbo: transmitter in error state bus off bit 1 = transmitter is in bus off state 0 = transmitter is not in bus off state bit 12 txbp: transmitter in error state bus passive bit 1 = transmitter is in bus passive state 0 = transmitter is not in bus passive state bit 11 rxbp: receiver in error state bus passive bit 1 = receiver is in bus passive state 0 = receiver is not in bus passive state bit 10 txwar: transmitter in error state warning bit 1 = transmitter is in error warning state 0 = transmitter is not in error warning state bit 9 rxwar: receiver in error state warning bit 1 = receiver is in error warning state 0 = receiver is not in error warning state bit 8 ewarn: transmitter or receiver in error state warning bit 1 = transmitter or receiver is in error warning state 0 = transmitter or receiver is not in error warning state bit 7 ivrif: invalid message interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 6 wakif: bus wake-up activity interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 5 errif: error interrupt flag bit (multiple sources in cxintf<13:8>) 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 4 unimplemented: read as ? 0 ? bit 3 fifoif: fifo almost full interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 2 rbovif: rx buffer overflow interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 294 ? 2011-2013 microchip technology inc. bit 1 rbif: rx buffer interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 0 tbif: tx buffer interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred register 21-6: cxintf: ecanx inte rrupt flag register (continued)
? 2011-2013 microchip technology inc. ds70657g-page 295 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-7: cxinte: ecanx interrupt enable register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ivrie wakie errie ? fifoie rbovie rbie tbie bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7 ivrie: invalid message interrupt enable bit 1 = interrupt request is enabled 0 = interrupt request is not enabled bit 6 wakie: bus wake-up activity interrupt enable bit 1 = interrupt request is enabled 0 = interrupt request is not enabled bit 5 errie: error interrupt enable bit 1 = interrupt request is enabled 0 = interrupt request is not enabled bit 4 unimplemented: read as ? 0 ? bit 3 fifoie: fifo almost full interrupt enable bit 1 = interrupt request is enabled 0 = interrupt request is not enabled bit 2 rbovie: rx buffer overflow interrupt enable bit 1 = interrupt request is enabled 0 = interrupt request is not enabled bit 1 rbie: rx buffer interrupt enable bit 1 = interrupt request is enabled 0 = interrupt request is not enabled bit 0 tbie: tx buffer interrupt enable bit 1 = interrupt request is enabled 0 = interrupt request is not enabled
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 296 ? 2011-2013 microchip technology inc. register 21-8: cxec: ecanx transmi t/receive error count register r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 terrcnt<7:0> bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 rerrcnt<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 terrcnt<7:0>: transmit error count bits bit 7-0 rerrcnt<7:0>: receive error count bits register 21-9: cxcfg1: ecanx baud ra te configuration register 1 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sjw<1:0> brp<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-6 sjw<1:0>: synchronization jump width bits 11 = length is 4 x t q 10 = length is 3 x t q 01 = length is 2 x t q 00 = length is 1 x t q bit 5-0 brp<5:0>: baud rate prescaler bits 11 1111 = t q = 2 x 64 x 1/f can ? ? ? 00 0010 = t q = 2 x 3 x 1/f can 00 0001 = t q = 2 x 2 x 1/f can 00 0000 = t q = 2 x 1 x 1/f can
? 2011-2013 microchip technology inc. ds70657g-page 297 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-10: cxcfg2: ecanx baud rate configuration register 2 u-0 r/w-x u-0 u-0 u-0 r/w-x r/w-x r/w-x ? wakfil ? ? ? seg2ph<2:0> bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x seg2phts sam seg1ph<2:0> prseg<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14 wakfil: select can bus line filter for wake-up bit 1 = uses can bus line filter for wake-up 0 = can bus line filter is not used for wake-up bit 13-11 unimplemented: read as ? 0 ? bit 10-8 seg2ph<2:0>: phase segment 2 bits 111 = length is 8 x t q ? ? ? 000 = length is 1 x t q bit 7 seg2phts: phase segment 2 time select bit 1 = freely programmable 0 = maximum of seg1phx bits or information processing time (ipt), whichever is greater bit 6 sam: sample of the can bus line bit 1 = bus line is sampled three times at the sample point 0 = bus line is sampled once at the sample point bit 5-3 seg1ph<2:0>: phase segment 1 bits 111 = length is 8 x t q ? ? ? 000 = length is 1 x t q bit 2-0 prseg<2:0>: propagation time segment bits 111 = length is 8 x t q ? ? ? 000 = length is 1 x t q
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 298 ? 2011-2013 microchip technology inc. register 21-11: cxfen1: ecanx acceptance filter enable register 1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 flten15 flten14 flten13 flten12 flten11 flten10 flten9 flten8 bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 flten7 flten6 flten5 flten4 flten3 flten2 flten1 flten0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 flten<15:0>: enable filter n to accept messages bits 1 = enables filter n 0 = disables filter n register 21-12: cxbufpnt1: ecanx filter 0-3 buffer pointer register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f3bp<3:0> f2bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f1bp<3:0> f0bp<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f3bp<3:0>: rx buffer mask for filter 3 bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0 bit 11-8 f2bp<3:0>: rx buffer mask for filter 2 bits (same values as bits<15:12>) bit 7-4 f1bp<3:0>: rx buffer mask for filter 1 bits (same values as bits<15:12>) bit 3-0 f0bp<3:0>: rx buffer mask for filter 0 bits (same values as bits<15:12>)
? 2011-2013 microchip technology inc. ds70657g-page 299 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-13: cxbufpnt2: ecanx filter 4-7 buffer pointer register 2 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f7bp<3:0> f6bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f5bp<3:0> f4bp<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f7bp<3:0>: rx buffer mask for filter 7 bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0 bit 11-8 f6bp<3:0>: rx buffer mask for filter 6 bits (same values as bits<15:12>) bit 7-4 f5bp<3:0>: rx buffer mask for filter 5 bits (same values as bits<15:12>) bit 3-0 f4bp<3:0>: rx buffer mask for filter 4 bits (same values as bits<15:12>) register 21-14: cxbufpnt3: ecanx filter 8-11 buffer pointer register 3 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f11bp<3:0> f10bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f9bp<3:0> f8bp<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f11bp<3:0>: rx buffer mask for filter 11 bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0 bit 11-8 f10bp<3:0>: rx buffer mask for filter 10 bits (same values as bits<15:12>) bit 7-4 f9bp<3:0>: rx buffer mask for filter 9 bits (same values as bits<15:12>) bit 3-0 f8bp<3:0>: rx buffer mask for filter 8 bits (same values as bits<15:12>)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 300 ? 2011-2013 microchip technology inc. register 21-15: cxbufpnt4: ecanx filter 12-15 buffer pointer register 4 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f15bp<3:0> f14bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f13bp<3:0> f12bp<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f15bp<3:0>: rx buffer mask for filter 15 bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0 bit 11-8 f14bp<3:0>: rx buffer mask for filter 14 bits (same values as bits<15:12>) bit 7-4 f13bp<3:0>: rx buffer mask for filter 13 bits (same values as bits<15:12>) bit 3-0 f12bp<3:0>: rx buffer mask for filter 12 bits (same values as bits<15:12>)
? 2011-2013 microchip technology inc. ds70657g-page 301 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-16: cxrxfnsid: ecanx acceptance filter n standard identifier register (n = 0-15) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid10 sid9 sid8 sid7 sid6 sid5 sid4 sid3 bit 15 bit 8 r/w-x r/w-x r/w-x u-0 r/w-x u-0 r/w-x r/w-x sid2 sid1 sid0 ? exide ?eid17eid16 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 sid<10:0>: standard identifier bits 1 = message address bit, sidx, must be ? 1 ? to match filter 0 = message address bit, sidx, must be ? 0 ? to match filter bit 4 unimplemented: read as ? 0 ? bit 3 exide: extended identifier enable bit if mide = 1 : 1 = matches only messages with extended identifier addresses 0 = matches only messages with standard identifier addresses if mide = 0 : ignores exide bit. bit 2 unimplemented: read as ? 0 ? bit 1-0 eid<17:16>: extended identifier bits 1 = message address bit, eidx, must be ? 1 ? to match filter 0 = message address bit, eidx, must be ? 0 ? to match filter
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 302 ? 2011-2013 microchip technology inc. register 21-17: cxrxfneid: ecanx acceptance filter n extended identifier register (n = 0-15) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 eid<15:0>: extended identifier bits 1 = message address bit, eidx, must be ? 1 ? to match filter 0 = message address bit, eidx, must be ? 0 ? to match filter register 21-18: cxfmsksel1: ecan x filter 7-0 mask selection register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f7msk<1:0> f6msk<1:0> f5msk<1:0> f4msk<1:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f3msk<1:0> f2msk<1:0> f1msk<1:0> f0msk<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 f7msk<1:0>: mask source for filter 7 bits 11 = reserved 10 = acceptance mask 2 registers contain mask 01 = acceptance mask 1 registers contain mask 00 = acceptance mask 0 registers contain mask bit 13-12 f6msk<1:0>: mask source for filter 6 bits (same values as bits<15:14>) bit 11-10 f5msk<1:0>: mask source for filter 5 bits (same values as bits<15:14>) bit 9-8 f4msk<1:0>: mask source for filter 4 bits (same values as bits<15:14>) bit 7-6 f3msk<1:0>: mask source for filter 3 bits (same values as bits<15:14>) bit 5-4 f2msk<1:0>: mask source for filter 2 bits (same values as bits<15:14>) bit 3-2 f1msk<1:0>: mask source for filter 1 bits (same values as bits<15:14>) bit 1-0 f0msk<1:0>: mask source for filter 0 bits (same values as bits<15:14>)
? 2011-2013 microchip technology inc. ds70657g-page 303 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-19: cxfmsksel2: ecan x filter 15-8 mask selection register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f15msk<1:0> f14msk<1:0> f13msk<1:0> f12msk<1:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f11msk<1:0> f10msk<1:0> f9msk<1:0> f8msk<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 f15msk<1:0>: mask source for filter 15 bits 11 = reserved 10 = acceptance mask 2 registers contain mask 01 = acceptance mask 1 registers contain mask 00 = acceptance mask 0 registers contain mask bit 13-12 f14msk<1:0>: mask source for filter 14 bits (same values as bits<15:14>) bit 11-10 f13msk<1:0>: mask source for filter 13 bits (same values as bits<15:14>) bit 9-8 f12msk<1:0>: mask source for filter 12 bits (same values as bits<15:14>) bit 7-6 f11msk<1:0>: mask source for filter 11 bits (same values as bits<15:14>) bit 5-4 f10msk<1:0>: mask source for filter 10 bits (same values as bits<15:14>) bit 3-2 f9msk<1:0>: mask source for filter 9 bits (same values as bits<15:14>) bit 1-0 f8msk<1:0>: mask source for filter 8 bits (same values as bits<15:14>)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 304 ? 2011-2013 microchip technology inc. register 21-20: cxrxmnsid: ecan x acceptance filter mask n standard identifier register (n = 0-2) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid10 sid9 sid8 sid7 sid6 sid5 sid4 sid3 bit 15 bit 8 r/w-x r/w-x r/w-x u-0 r/w-x u-0 r/w-x r/w-x sid2 sid1 sid0 ?mide ?eid17eid16 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 sid<10:0>: standard identifier bits 1 = includes bit, sidx, in filter comparison 0 = sidx bit is a don?t care in filter comparison bit 4 unimplemented: read as ? 0 ? bit 3 mide: identifier receive mode bit 1 = matches only message types (standard or extended addr ess) that correspond to exide bit in the filter 0 = matches either standard or extended address message if filters match (i.e., if (filter sid) = (message sid) or if (filter sid/eid) = (message sid/eid)) bit 2 unimplemented: read as ? 0 ? bit 1-0 eid<17:16>: extended identifier bits 1 = includes bit, eidx, in filter comparison 0 = eidx bit is a don?t care in filter comparison register 21-21: cxrxmneid: ecan x acceptance filter mask n extended identifier register (n = 0-2) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 eid<15:0>: extended identifier bits 1 = includes bit, eidx, in filter comparison 0 = eidx bit is a don?t care in filter comparison
? 2011-2013 microchip technology inc. ds70657g-page 305 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-22: cxrxful1: ecanx receive buffer full register 1 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful15 rxful14 rxful13 rxful12 rxful11 rxful10 rxful9 rxful8 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful7 rxful6 rxful5 rxful4 rxful3 rxful2 rxful1 rxful0 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxful<15:0>: receive buffer n full bits 1 = buffer is full (set by module) 0 = buffer is empty (cleared by user software) register 21-23: cxrxful2: ecanx receive buffer full register 2 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful31 rxful30 rxful29 rxful28 rxful27 rxful26 rxful25 rxful24 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful23 rxful22 rxful21 rxful20 rxful19 rxful18 rxful17 rxful16 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxful<31:16>: receive buffer n full bits 1 = buffer is full (set by module) 0 = buffer is empty (cleared by user software)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 306 ? 2011-2013 microchip technology inc. register 21-24: cxrxovf1: ecanx receive buffer overflow register 1 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf15 rxovf14 rxovf13 rxovf12 rxovf11 rxovf10 rxovf9 rxovf8 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf7 rxovf6 rxovf5 rxovf4 rxovf3 rxovf2 rxovf1 rxovf0 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxovf<15:0>: receive buffer n overflow bits 1 = module attempted to write to a full buffer (set by module) 0 = no overflow condition (cleared by user software) register 21-25: cxrxovf2: ecanx receive buffer overflow register 2 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf31 rxovf30 rxovf29 rxovf28 rxovf27 rxovf26 rxovf25 rxovf24 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf23 rxovf22 rxovf21 rxovf20 rxovf19 rxovf18 rxovf17 rxovf16 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxovf<31:16>: receive buffer n overflow bits 1 = module attempted to write to a full buffer (set by module) 0 = no overflow condition (cleared by user software)
? 2011-2013 microchip technology inc. ds70657g-page 307 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 21-26: cxtrmncon: ecanx tx/rx buffer mn control register (m = 0,2,4,6; n = 1,3,5,7) r/w-0 r-0 r-0 r-0 r/w-0 r/w-0 r/w-0 r/w-0 txenn txabtn txlarbn txerrn txreqn rtrenn txnpri<1:0> bit 15 bit 8 r/w-0 r-0 r-0 r-0 r/w-0 r/w-0 r/w-0 r/w-0 txenm txabtm ( 1 ) txlarbm ( 1 ) txerrm ( 1 ) txreqm rtrenm txmpri<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 see definition for bits<7:0>, controls buffer n bit 7 txenm: tx/rx buffer selection bit 1 = buffer trbn is a transmit buffer 0 = buffer trbn is a receive buffer bit 6 txabtm: message aborted bit ( 1 ) 1 = message was aborted 0 = message completed transmission successfully bit 5 txlarbm: message lost arbitration bit ( 1 ) 1 = message lost arbitration while being sent 0 = message did not lose arbitration while being sent bit 4 txerrm: error detected during transmission bit ( 1 ) 1 = a bus error occurred while the message was being sent 0 = a bus error did not occur while the message was being sent bit 3 txreqm: message send request bit 1 = requests that a message be sent; the bit automatically clears when the message is successfully sent 0 = clearing the bit to ? 0 ? while set requests a message abort bit 2 rtrenm: auto-remote transmit enable bit 1 = when a remote transmit is received, txreq will be set 0 = when a remote transmit is received, txreq will be unaffected bit 1-0 txmpri<1:0>: message transmission priority bits 11 = highest message priority 10 = high intermediate message priority 01 = low intermediate message priority 00 = lowest message priority note 1: this bit is cleared when txreq is set. note: the buffers, sid, eid, dlc, data field, and receive status registers are located in dma ram.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 308 ? 2011-2013 microchip technology inc. 21.5 ecan message buffers ecan message buffers are part of ram memory. they are not ecan special function registers. the user application must directly write into the ram area that is configured for ecan message buffers. the location and size of the buffer area is defined by the user application. buffer 21-1: ecan? message buffer word 0 u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? sid10 sid9 sid8 sid7 sid6 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid5 sid4 sid3 sid2 sid1 sid0 srr ide bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-2 sid<10:0>: standard identifier bits bit 1 srr: substitute remote request bit when ide = 0 : 1 = message will request remote transmission 0 = normal message when ide = 1 : the srr bit must be set to ? 1 ?. bit 0 ide: extended identifier bit 1 = message will transmit extended identifier 0 = message will transmit standard identifier buffer 21-2: ecan? message buffer word 1 u-0 u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x ? ? ? ? eid17 eid16 eid15 eid14 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid13 eid12 eid11 eid10 eid9 eid8 eid7 eid6 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-0 eid<17:6>: extended identifier bits
? 2011-2013 microchip technology inc. ds70657g-page 309 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ( buffer 21-3: ecan? message buffer word 2 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid5 eid4 eid3 eid2 eid1 eid0 rtr rb1 bit 15 bit 8 u-x u-x u-x r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? rb0 dlc3 dlc2 dlc1 dlc0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 eid<5:0>: extended identifier bits bit 9 rtr: remote transmission request bit when ide = 1 : 1 = message will request remote transmission 0 = normal message when ide = 0 : the rtr bit is ignored. bit 8 rb1: reserved bit 1 user must set this bit to ? 0 ? per can protocol. bit 7-5 unimplemented: read as ? 0 ? bit 4 rb0: reserved bit 0 user must set this bit to ? 0 ? per can protocol. bit 3-0 dlc<3:0>: data length code bits buffer 21-4: ecan ? message buffer word 3 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 1 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 byte 1<15:8>: ecan message byte 0 bits bit 7-0 byte 0<7:0>: ecan message byte 1 bits
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 310 ? 2011-2013 microchip technology inc. buffer 21-5: ecan ? message buffer word 4 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 3 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 2 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 byte 3<15:8>: ecan message byte 3 bits bit 7-0 byte 2<7:0>: ecan message byte 2 bits buffer 21-6: ecan ? message buffer word 5 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 5 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 4 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 byte 5<15:8>: ecan message byte 5 bits bit 7-0 byte 4<7:0>: ecan message byte 4 bits
? 2011-2013 microchip technology inc. ds70657g-page 311 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x buffer 21-7: ecan ? message buffer word 6 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 7 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 6 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 byte 7<15:8>: ecan message byte 7 bits bit 7-0 byte 6<7:0>: ecan message byte 6 bits buffer 21-8: ecan? message buffer word 7 u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? filhit<4:0> ( 1 ) bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-8 filhit<4:0>: filter hit code bits ( 1 ) encodes number of filter that resulted in writing this buffer. bit 7-0 unimplemented: read as ? 0 ? note 1: only written by module for receive buffers, unused for transmit buffers.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 312 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 313 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 22.0 charge time measurement unit (ctmu) the charge time measurement unit is a flexible analog module that provides accurate differential time measure- ment between pulse sources, as well as asynchronous pulse generation. its key features include: ? four edge input trigger sources ? polarity control for each edge source ? control of edge sequence ? control of response to edges ? precise time measurement resolution of 1 ns ? accurate current source suitable for capacitive measurement ? on-chip temperature measurement using a built-in diode together with other on-chip analog modules, the ctmu can be used to precisely measure time, measure capacitance, measure relative changes in capacitance or generate output pulses that are independent of the system clock. the ctmu module is ideal for interfacing with capacitive-based sensors.the ctmu is controlled through three registers: ctmucon1, ctmucon2 and ctmuicon. ctmucon1 and ctmucon2 enable the module and control edge source selection, edge source polarity selection and edge sequencing. the ctmuicon register controls the selection and trim of the current source. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 33. ?charge time measurement unit (ctmu)? (ds70661) in the ? dspic33e/pic24e family reference manual? , which is available on the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 314 ? 2011-2013 microchip technology inc. figure 22-1: ctmu block diagram 22.1 ctmu resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 22.1.1 key resources ? section 33. ?charge time measurement unit (ctmu)? (ds70661) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools cted1 cted2 current source edge control logic ctmucon1 or ctmucon2 pulse generator ctmui to adc cmp1 timer1 oc1 current control itrim<5:0> irng<1:0> ctmuicon ctmu control logic edg1stat edg2stat analog-to-digital ctpls ic1 cmp1 c1in1- cdelay ctmu temp ctmu temperature sensor current control selection tgen edg1stat, edg2stat ctmu temp 0 edg1stat = edg2stat ctmui to adc 0 edg1stat ? edg2stat ctmup 1 edg1stat ? edg2stat no connect 1 edg1stat = edg2stat trigger tgen ctmup external capacitor for pulse generation note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 315 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 22.2 ctmu control registers register 22-1: ctmucon1: ct mu control register 1 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ctmuen ? ctmusidl tgen edgen edgseqen idissen ( 1 ) cttrig bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ctmuen: ctmu enable bit 1 = module is enabled 0 = module is disabled bit 14 unimplemented: read as ? 0 ? bit 13 ctmusidl: ctmu stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12 tgen: time generation enable bit 1 = enables edge delay generation 0 = disables edge delay generation bit 11 edgen: edge enable bit 1 = hardware modules are used to trigger edges (tmrx, ctedx, etc.) 0 = software is used to trigger edges (manual set of edgxstat) bit 10 edgseqen: edge sequence enable bit 1 = edge 1 event must occur before edge 2 event can occur 0 = no edge sequence is needed bit 9 idissen: analog current source control bit ( 1 ) 1 = analog current source output is grounded 0 = analog current source output is not grounded bit 8 cttrig: adc trigger control bit 1 = ctmu triggers adc start of conversion 0 = ctmu does not trigger adc start of conversion bit 7-0 unimplemented: read as ? 0 ? note 1: the adc module sample-and-hold capacitor is not automatically discharged between sample/conversion cycles. software using the adc as part of a capacitance measurement must discharge the adc capacitor before conducting the measurement. the idissen bit, when set to ? 1 ?, performs this function. the adc must be sampling while the idissen bit is active to connect the discharge sink to the capacitor array.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 316 ? 2011-2013 microchip technology inc. register 22-2: ctmucon2: ct mu control register 2 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 edg1mod edg1pol edg1sel<3:0> edg2stat edg1stat bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 edg2mod edg2pol edg2sel<3:0> ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 edg1mod: edge 1 edge sampling mode selection bit 1 = edge 1 is edge-sensitive 0 = edge 1 is level-sensitive bit 14 edg1pol: edge 1 polarity select bit 1 = edge 1 is programmed for a positive edge response 0 = edge 1 is programmed for a negative edge response bit 13-10 edg1sel<3:0>: edge 1 source select bits 1xxx = reserved 01xx = reserved 0011 = cted1 pin 0010 = cted2 pin 0001 = oc1 module 0000 = timer1 module bit 9 edg2stat: edge 2 status bit indicates the status of edge 2 and can be written to control the edge source. 1 = edge 2 has occurred 0 = edge 2 has not occurred bit 8 edg1stat: edge 1 status bit indicates the status of edge 1 and can be written to control the edge source. 1 = edge 1 has occurred 0 = edge 1 has not occurred bit 7 edg2mod: edge 2 edge sampling mode selection bit 1 = edge 2 is edge-sensitive 0 = edge 2 is level-sensitive bit 6 edg2pol: edge 2 polarity select bit 1 = edge 2 is programmed for a positive edge response 0 = edge 2 is programmed for a negative edge response bit 5-2 edg2sel<3:0>: edge 2 source select bits 1111 = reserved 01xx = reserved 0100 = cmp1 module 0011 = cted2 pin 0010 = cted1 pin 0001 = oc1 module 0000 = ic1 module bit 1-0 unimplemented: read as ? 0 ?
? 2011-2013 microchip technology inc. ds70657g-page 317 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 22-3: ctmuicon: ctmu current control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 itrim<5:0> irng<1:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 itrim<5:0>: current source trim bits 011111 = maximum positive change from nominal current + 62% 011110 = maximum positive change from nominal current + 60% ? ? ? 000010 = minimum positive change from nominal current + 4% 000001 = minimum positive change from nominal current + 2% 000000 = nominal current output specified by irng<1:0> 111111 = minimum negative change from nominal current ? 2% 111110 = minimum negative change from nominal current ? 4% ? ? ? 100010 = maximum negative change from nominal current ? 60% 100001 = maximum negative change from nominal current ? 62% bit 9-8 irng<1:0>: current source range select bits 11 = 100 ? base current ( 2 ) 10 = 10 ? base current ( 2 ) 01 = base current level ( 2 ) 00 = 1000 ? base current ( 1 , 2 ) bit 7-0 unimplemented: read as ? 0 ? note 1: this current range is not available to be used with the internal temperature measurement diode. 2: refer to the ctmu current source specifications ( table 30-56 ) in section 30.0 ?electrical characteristics? for the current range selection values.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 318 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 319 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 23.0 10-bit/12-bit analog-to-digital converter (adc) the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices have one adc module. the adc module supports up to 16 analog input channels. on adc1, the ad12b bit (ad1con1<10>) allows the adc module to be configured by the user as either a 10-bit, 4 sample-and-hold (s&h) adc (default configuration) or a 12-bit, 1 s&h adc. 23.1 key features 23.1.1 10-bit adc configuration the 10-bit adc configuration has the following key features: ? successive approximation (sar) conversion ? conversion speeds of up to 1.1 msps ? up to 16 analog input pins ? connections to three internal op amps ? connections to the charge time measurement unit (ctmu) and temperature measurement diode ? channel selection and triggering can be controlled by the peripheral trigger generator (ptg) ? external voltage reference input pins ? simultaneous sampling of: - up to four analog input pins - three op amp outputs - combinations of analog inputs and op amp outputs ? automatic channel scan mode ? selectable conversion trigger source ? selectable buffer fill modes ? four result alignment options (signed/unsigned, fractional/integer) ? operation during cpu sleep and idle modes 23.1.2 12-bit adc configuration the 12-bit adc configuration supports all the features listed above, with the exception of the following: ? in the 12-bit configuration, conversion speeds of up to 500 ksps are supported ? there is only one s&h amplifier in the 12-bit configuration; therefore, simultaneous sampling of multiple channels is not supported. depending on the particular device pinout, the adc can have up to 16 analog input pins, designated an0 through an15. these analog inputs are shared with op amp inputs and outputs, comparator inputs, and external voltage references. when op amp/comparator functionality is enabled, or an external voltage refer- ence is used, the analog input that shares that pin is no longer available. the actual number of analog input pins, op amps and external voltage reference input configuration depends on the specific device. a block diagram of the adc module is shown in figure 23-1 . figure 23-2 provides a diagram of the adc conversion clock period. note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 16. ?analog-to- digital converter (adc)? (ds70621) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: the adc module needs to be disabled before modifying the ad12b bit.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 320 ? 2011-2013 microchip technology inc. figure 23-1: adc module block diagram with co nnection options for anx pins and op amps 0 1 + ? cmp1 /oa1 0x 10 11 v refl v refl v refl + ? ch0 0 1 v refl an0-anx oa1-oa3 ch0sx ch0nx ch123nx 00000 11111 opmode opmode opmode a b 1 0 ch0sa<4:0> (3) ch0sb<4:0> (3) ch0sx ch0nx ch0na (3) ch0nb (3) cscna ch123sx ch123nx ch123sa ch123sb ch123na<2:0> ch123nb<2:0> s&h1 alternate input selection channel scan this diagram depicts all of the available adc connection options to the four s&h amplifiers, which are designated: ch0, ch1, ch2 and ch3. the anx analog pins or op amp outputs are connected to the ch0-ch3 amplifi- ers through the multiplexers, controlled by the sfr control bits, ch0sx, chonx, ch123sx and ch123nx. a b a b a b + ? ch1 + ? ch2 + ? ch3 0 1 ch123x + ? oa2 0 1 ch123sx 0x 10 11 ch123nx 0x 10 11 ch123nx + ? oa3 (5) ch123sx an0/oa2out/ra0 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 an9/rpi27/ra11 an1/c2in1+/ra1 an10/rpi28/ra12 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 an8/c3in1+/u1rts /bclk1/rc2 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an11/c1in2-/u1cts /rc11 + ? oa1 v ref + (1) av dd av ss v ref - (1) vcfg<2:0> adc1buf0 (4) adc1buf1 (4) adc1buf2 (4) adc1buff (4) adc1bufe (4) from ctmu current source (ctmui) ctmu temp s&h2 s&h3 s&h0 note 1: v ref +, v ref - inputs can be multiplexed with other analog inputs. 2: channels 1, 2 and 3 are not applicable for the 12-bit mode of operation. 3: these bits can be updated with step commands from the ptg module. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. 4: when addmaen (ad1con4<8>) = 1 , enabling dma, only adc1buf0 is used. 5: oa3 is not available for 28-pin devices. open alts (muxa/muxb) sar adc v refh v refl
? 2011-2013 microchip technology inc. ds70657g-page 321 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 23-2: adc conversion clock period block diagram 1 0 adc conversion clock multiplier 1, 2, 3, 4, 5,..., 256 ad1con3<15> t p (1) t ad 6 ad1con3<7:0> note 1: t p = 1/f p . 2: see the adc electrical specifications in section 30.0 ?electrical characteristics? for the exact rc clock value. adc internal rc clock (2)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 322 ? 2011-2013 microchip technology inc. 23.2 adc helpful tips 1. the smpix control bits in the ad1con2 register: a) determine when the adc interrupt flag is set and an interrupt is generated, if enabled. b) when the cscna bit in the ad1con2 reg- isters is set to ? 1 ?, this determines when the adc analog scan channel list, defined in the ad1cssl/ad1cssh registers, starts over from the beginning. c) when the dma peripheral is not used (addmaen = 0 ), this determines when the adc result buffer pointer to adc1buf0- adc1buff gets reset back to the beginning at adc1buf0. d) when the dma peripheral is used (addmaen = 1 ), this determines when the dma address pointer is incremented after a sample/conversion operation. adc1buf0 is the only adc buffer used in this mode. the adc result buffer pointer to adc1buf0- adc1buff gets reset back to the beginning at adc1buf0. the dma address is incremented after completion of every 32nd sample/conversion operation. conversion results are stored in the adc1buf0 register for transfer to ram using dma. 2. when the dma module is disabled (addmaen = 0 ), the adc has 16 result buffers. adc conversion results are stored sequentially in adc1buf0-adc1buff, regardless of which analog inputs are being used subject to the smpix bits and the condition described in 1c) above. there is no relationship between the anx input being measured and which adc buffer (adc1buf0-adc1buff) that the conversion results will be placed in. 3. when the dma module is enabled (addmaen = 1 ), the adc module has only 1 adc result buffer (i.e., adc1buf0) per adc peripheral and the adc conversion result must be read, either by the cpu or dma controller, before the next adc conversion is complete to avoid overwriting the previous value. 4. the done bit (ad1con1<0>) is only cleared at the start of each conversion and is set at the completion of the conversion, but remains set indefinitely, even through the next sample phase until the next conversion begins. if application code is monitoring the done bit in any kind of software loop, the user must consider this behav- ior because the cpu code execution is faster than the adc. as a result, in manual sample mode, particularly where the user?s code is set- ting the samp bit (ad1con1<1>), the done bit should also be cleared by the user application just before setting the samp bit. 5. enabling op amps, comparator inputs and exter- nal voltage references can limit the availability of analog inputs (anx pins). for example, when op amp 2 is enabled, the pins for an0, an1 and an2 are used by the op amp?s inputs and output. this negates the usefulness of alternate input mode since the muxa selections use an0-an2. care- fully study the adc block diagram to determine the configuration that will best suit your applica- tion. configuration examples are available in section 16. ?analog-to-digital converter (adc)? (ds70621) in the ?dspic33e/pic24e family reference manual? . 23.3 adc resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 23.3.1 key resources ? section 16. ?analog-to-digital converter (adc)? (ds70621) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 323 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 23.4 adc control registers register 23-1: ad1con1: adc1 control register 1 r/w-0 u-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 adon ? adsidl addmabm ?ad12b form<1:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0, hc, hs r/c-0, hc, hs ssrc<2:0> ssrcg simsam asam samp done ( 3 ) bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 adon: adc operating mode bit 1 = adc module is operating 0 = adc is off bit 14 unimplemented: read as ? 0 ? bit 13 adsidl: adc stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12 addmabm: dma buffer build mode bit 1 = dma buffers are written in the order of conversion; the module provides an address to the dma channel that is the same as the address used for the non-dma stand-alone buffer 0 = dma buffers are written in scatter/gather mode; the module provides a scatter/gather address to the dma channel, based on the index of the analog input and the size of the dma buffer. bit 11 unimplemented: read as ? 0 ? bit 10 ad12b: adc 10-bit or 12-bit operation mode bit 1 = 12-bit, 1-channel adc operation 0 = 10-bit, 4-channel adc operation bit 9-8 form<1:0>: data output format bits for 10-bit operation: 11 = signed fractional (d out = sddd dddd dd00 0000 , where s = .not.d<9>) 10 = fractional (d out = dddd dddd dd00 0000 ) 01 = signed integer (d out = ssss sssd dddd dddd , where s = .not.d<9>) 00 = integer (d out = 0000 00dd dddd dddd ) for 12-bit operation: 11 = signed fractional (d out = sddd dddd dddd 0000 , where s = .not.d<11>) 10 = fractional (d out = dddd dddd dddd 0000 ) 01 = signed integer (d out = ssss sddd dddd dddd , where s = .not.d<11>) 00 = integer (d out = 0000 dddd dddd dddd ) note 1: see section 24.0 ?peripheral trigger generator (ptg) module? for information on this selection. 2: this setting is available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 3: do not clear the done bit in software if auto-sample is enabled (asam = 1 ).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 324 ? 2011-2013 microchip technology inc. bit 7-5 ssrc<2:0>: sample trigger source select bits if ssrcg = 1 : 111 = reserved 110 = ptgo15 primary trigger compare ends sampling and starts conversion ( 1 ) 101 = ptgo14 primary trigger compare ends sampling and starts conversion ( 1 ) 100 = ptgo13 primary trigger compare ends sampling and starts conversion ( 1 ) 011 = ptgo12 primary trigger compare ends sampling and starts conversion ( 1 ) 010 = pwm generator 3 primary trigger compare ends sampling and starts conversion ( 2 ) 001 = pwm generator 2 primary trigger compare ends sampling and starts conversion ( 2 ) 000 = pwm generator 1 primary trigger compare ends sampling and starts conversion ( 2 ) if ssrcg = 0 : 111 = internal counter ends sampling and starts conversion (auto-convert) 110 = ctmu ends sampling and starts conversion 101 = reserved 100 = timer5 compare ends sampling and starts conversion 011 = pwm primary special event trigger ends sampling and starts conversion ( 2 ) 010 = timer3 compare ends sampling and starts conversion 001 = active transition on the int0 pin ends sampling and starts conversion 000 = clearing the sample bit (samp) ends sampling and starts conversion (manual mode) bit 4 ssrcg: sample trigger source group bit see ssrc<2:0> for details. bit 3 simsam: simultaneous sample select bit (only applicable when chps<1:0> = 01 or 1x ) in 12-bit mode (ad21b = 1 ), simsam is unimplemented and is read as ? 0 ?: 1 = samples ch0, ch1, ch2, ch3 simultaneously (when chps<1:0> = 1x ); or samples ch0 and ch1 simultaneously (when chps<1:0> = 01 ) 0 = samples multiple channels individually in sequence bit 2 asam: adc sample auto-start bit 1 = sampling begins immediately after the last conversion; samp bit is auto-set 0 = sampling begins when the samp bit is set bit 1 samp: adc sample enable bit 1 = adc sample-and-hold amplifiers are sampling 0 = adc sample-and-hold amplifiers are holding if asam = 0 , software can write ? 1 ? to begin sampling. automatically set by hardware if asam = 1 . if ssrc<2:0> = 000 , software can write ? 0 ? to end sampling and start conversion. if ssrc<2:0> ?? 000 , automatically cleared by hardware to end sampling and start conversion. bit 0 done: adc conversion status bit ( 3 ) 1 = adc conversion cycle has completed 0 = adc conversion has not started or is in progress automatically set by hardware when the a/d conversion is complete. software can write ? 0 ? to clear the done status bit (software is not allowed to write ? 1 ?). clearing this bit does not affect any operation in progress. automatically cleared by hardware at the start of a new conversion. register 23-1: ad1con1: adc1 control register 1 (continued) note 1: see section 24.0 ?peripheral trigger generator (ptg) module? for information on this selection. 2: this setting is available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 3: do not clear the done bit in software if auto-sample is enabled (asam = 1 ).
? 2011-2013 microchip technology inc. ds70657g-page 325 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 23-2: ad1con2: adc1 control register 2 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 vcfg<2:0> ? ? cscna chps<1:0> bit 15 bit 8 r-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 bufs smpi<4:0> bufm alts bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 vcfg<2:0>: converter voltage reference configuration bits bit 12-11 unimplemented: read as ? 0 ? bit 10 cscna: input scan select bit 1 = scans inputs for ch0+ during sample muxa 0 = does not scan inputs bit 9-8 chps<1:0>: channel select bits in 12-bit mode (ad21b = 1 ), the chps<1:0> bits are unimplemented and are read as ? 0 ?: 1x = converts ch0, ch1, ch2 and ch3 01 = converts ch0 and ch1 00 = converts ch0 bit 7 bufs: buffer fill status bit (only valid when bufm = 1 ) 1 = adc is currently filling the second half of the buffer; the user application should access data in the first half of the buffer 0 = adc is currently filling the first half of the buffer; the user application should access data in the second half of the buffer bit 6-2 smpi<4:0>: increment rate bits when addmaen = 0 : x1111 = generates interrupt after completion of every 16th sample/conversion operation x1110 = generates interrupt after completion of every 15th sample/conversion operation ? ? ? x0001 = generates interrupt after completion of every 2nd sample/conversion operation x0000 = generates interrupt after completion of every sample/conversion operation when addmaen = 1 : 11111 = increments the dma address after completion of every 32nd sample/conversion operation 11110 = increments the dma address after completion of every 31st sample/conversion operation ? ? ? 00001 = increments the dma address after completion of every 2nd sample/conversion operation 00000 = increments the dma address after completion of every sample/conversion operation value v refh v refl 000 a vdd avss 001 external v ref +avss 010 a vdd external v ref - 011 external v ref + external v ref - 1xx a vdd a vss
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 326 ? 2011-2013 microchip technology inc. bit 1 bufm: buffer fill mode select bit 1 = starts the buffer filling the first half of the buffer on the first interrupt and the second half of the buffer on next interrupt 0 = always starts filling the buffer from the start address. bit 0 alts: alternate input sample mode select bit 1 = uses channel input selects for sample muxa on first sample and sample muxb on next sample 0 = always uses channel input selects for sample muxa register 23-2: ad1con2: adc1 control register 2 (continued)
? 2011-2013 microchip technology inc. ds70657g-page 327 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 23-3: ad1con3: adc1 control register 3 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adrc ? ? samc<4:0> ( 1 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adcs<7:0> ( 2 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 adrc: adc conversion clock source bit 1 = adc internal rc clock 0 = clock derived from system clock bit 14-13 unimplemented: read as ? 0 ? bit 12-8 samc<4:0>: auto-sample time bits ( 1 ) 11111 = 31 t ad ? ? ? 00001 = 1 t ad 00000 = 0 t ad bit 7-0 adcs<7:0>: adc conversion clock select bits ( 2 ) 11111111 = t p ? (adcs<7:0> + 1) = t p ? 256 = t ad ? ? ? 00000010 = t p ? (adcs<7:0> + 1) = t p ? 3 = t ad 00000001 = t p ? (adcs<7:0> + 1) = t p ? 2 = t ad 00000000 = t p ? (adcs<7:0> + 1) = t p ? 1 = t ad note 1: this bit is only used if ssrc<2:0> (ad1con1<7:5>) = 111 and ssrcg (ad1con1<4>) = 0 . 2: this bit is not used if adrc (ad1con3<15>) = 1 .
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 328 ? 2011-2013 microchip technology inc. register 23-4: ad1con4: adc1 control register 4 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 ? ? ? ? ? ? ? addmaen bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? dmabl<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-9 unimplemented: read as ? 0 ? bit 8 addmaen: adc dma enable bit 1 = conversion results are stored in the adc1buf0 register for transfer to ram using dma 0 = conversion results are stored in adc1buf0 through adc1buff registers; dma will not be used bit 7-3 unimplemented: read as ? 0 ? bit 2-0 dmabl<2:0>: selects number of dma buffer locations per analog input bits 111 = allocates 128 words of buffer to each analog input 110 = allocates 64 words of buffer to each analog input 101 = allocates 32 words of buffer to each analog input 100 = allocates 16 words of buffer to each analog input 011 = allocates 8 words of buffer to each analog input 010 = allocates 4 words of buffer to each analog input 001 = allocates 2 words of buffer to each analog input 000 = allocates 1 word of buffer to each analog input
? 2011-2013 microchip technology inc. ds70657g-page 329 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 23-5: ad1chs123: adc1 input channel 1, 2, 3 select register u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? ch123nb<1:0> ch123sb bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? ch123na<1:0> ch123sa bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10-9 ch123nb<1:0>: channel 1, 2, 3 negative input select for sample muxb bits in 12-bit mode (ad21b = 1 ), ch123nb is unimplemented and is read as ? 0 ?: bit 8 ch123sb: channel 1, 2, 3 positive input select for sample muxb bit in 12-bit mode (ad21b = 1 ), ch123sb is unimplemented and is read as ? 0 ?: bit 7-3 unimplemented: read as ? 0 ? bit 2-1 ch123na<1:0>: channel 1, 2, 3 negative input select for sample muxa bits in 12-bit mode (ad21b = 1 ), ch123na is unimplemented and is read as ? 0 ?: note 1: an0 through an7 are repurposed when comparator and op amp functionality is enabled. see figure 23-1 to determine how enabling a particular op amp or comparator affects selection choices for channels 1, 2 and 3. 2: the oax input is used if the corresponding op amp is selected (opmode (cmxcon<10>) = 1 ); otherwise, the anx input is used. value adc channel ch1 ch2 ch3 11 an9 an10 an11 10 ( 1 , 2 ) oa3/an6 an7 an8 0x v refl v refl v refl value adc channel ch1 ch2 ch3 1 ( 2 ) oa1/an3 oa2/an0 oa3/an6 0 ( 1 , 2 ) oa2/an0 an1 an2 value adc channel ch1 ch2 ch3 11 an9 an10 an11 10 ( 1 , 2 ) oa3/an6 an7 an8 0x v refl v refl v refl
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 330 ? 2011-2013 microchip technology inc. bit 0 ch123sa: channel 1, 2, 3 positive input select for sample muxa bit in 12-bit mode (ad21b = 1 ), ch123sa is unimplemented and is read as ? 0 ?: register 23-5: ad1chs123: adc1 input channel 1, 2, 3 select register (continued) note 1: an0 through an7 are repurposed when comparator and op amp functionality is enabled. see figure 23-1 to determine how enabling a particular op amp or comparator affects selection choices for channels 1, 2 and 3. 2: the oax input is used if the corresponding op amp is selected (opmode (cmxcon<10>) = 1 ); otherwise, the anx input is used. value adc channel ch1 ch2 ch3 1 ( 2 ) oa1/an3 oa2/an0 oa3/an6 0 ( 1 , 2 ) oa2/an0 an1 an2
? 2011-2013 microchip technology inc. ds70657g-page 331 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 23-6: ad1chs0: adc1 input channel 0 select register r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ch0nb ? ? ch0sb<4:0> ( 1 ) bit 15 bit 8 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ch0na ? ? ch0sa<4:0> ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ch0nb: channel 0 negative input select for sample muxb bit 1 = channel 0 negative input is an1 ( 1 ) 0 = channel 0 negative input is v refl bit 14-13 unimplemented: read as ? 0 ? bit 12-8 ch0sb<4:0>: channel 0 positive input select for sample muxb bits ( 1 ) 11111 = open; use this selection with ctmu capacitive and time measurement 11110 = channel 0 positive input is connected to the ctmu temperature measurement diode (ctmu temp) 11101 = reserved 11100 = reserved 11011 = reserved 11010 = channel 0 positive input is the output of oa3/an6 ( 2 , 3 ) 11001 = channel 0 positive input is the output of oa2/an0 ( 2 ) 11000 = channel 0 positive input is the output of oa1/an3 ( 2 ) 10111 = reserved ? ? ? 10000 = reserved 01111 = channel 0 positive input is an15 ( 3 ) 01110 = channel 0 positive input is an14 ( 3 ) 01101 = channel 0 positive input is an13 ( 3 ) ? ? ? 00010 = channel 0 positive input is an2 ( 3 ) 00001 = channel 0 positive input is an1 ( 3 ) 00000 = channel 0 positive input is an0 ( 3 ) bit 7 ch0na: channel 0 negative input select for sample muxa bit 1 = channel 0 negative input is an1 ( 1 ) 0 = channel 0 negative input is v refl bit 6-5 unimplemented: read as ? 0 ? note 1: an0 through an7 are repurposed when comparator and op amp functionality is enabled. see figure 23-1 to determine how enabling a particular op amp or comparator affects selection choices for channels 1, 2 and 3. 2: the oax input is used if the corresponding op amp is selected (opmode (cmxcon<10>) = 1 ); otherwise, the anx input is used. 3: see the ?pin diagrams? section for the available analog channels for each device.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 332 ? 2011-2013 microchip technology inc. bit 4-0 ch0sa<4:0>: channel 0 positive input select for sample muxa bits ( 1 ) 11111 = open; use this selection with ctmu capacitive and time measurement 11110 = channel 0 positive input is connected to the ctmu temperature measurement diode (ctmu temp) 11101 = reserved 11100 = reserved 11011 = reserved 11010 = channel 0 positive input is the output of oa3/an6 ( 2 , 3 ) 11001 = channel 0 positive input is the output of oa2/an0 ( 2 ) 11000 = channel 0 positive input is the output of oa1/an3 ( 2 ) 10110 = reserved ? ? ? 10000 = reserved 01111 = channel 0 positive input is an15 ( 1 , 3 ) 01110 = channel 0 positive input is an14 ( 1 , 3 ) 01101 = channel 0 positive input is an13 ( 1 , 3 ) ? ? ? 00010 = channel 0 positive input is an2 ( 1 , 3 ) 00001 = channel 0 positive input is an1 ( 1 , 3 ) 00000 = channel 0 positive input is an0 ( 1 , 3 ) register 23-6: ad1chs0: adc1 input channel 0 select register (continued) note 1: an0 through an7 are repurposed when comparator and op amp functionality is enabled. see figure 23-1 to determine how enabling a particular op amp or comparator affects selection choices for channels 1, 2 and 3. 2: the oax input is used if the corresponding op amp is selected (opmode (cmxcon<10>) = 1 ); otherwise, the anx input is used. 3: see the ?pin diagrams? section for the available analog channels for each device.
? 2011-2013 microchip technology inc. ds70657g-page 333 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 23-7: ad1cssh: adc1 input scan select register high ( 1 ) r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 css31 css30 ? ? ?css26 ( 2 ) css25 ( 2 ) css24 ( 2 ) bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 css31: adc input scan selection bit 1 = selects ctmu capacitive and time measurement for input scan (open) 0 = skips ctmu capacitive and time measurement for input scan (open) bit 14 css30: adc input scan selection bit 1 = selects ctmu on-chip temperature measurement for input scan (ctmu temp) 0 = skips ctmu on-chip temperature measurement for input scan (ctmu temp) bit 13-11 unimplemented: read as ? 0 ? bit 10 css26: adc input scan selection bit ( 2 ) 1 = selects oa3/an6 for input scan 0 = skips oa3/an6 for input scan bit 9 css25: adc input scan selection bit ( 2 ) 1 = selects oa2/an0 for input scan 0 = skips oa2/an0 for input scan bit 8 css24: adc input scan selection bit ( 2 ) 1 = selects oa1/an3 for input scan 0 = skips oa1/an3 for input scan bit 7-0 unimplemented: read as ? 0 ? note 1: all ad1cssh bits can be selected by user software. however, inputs selected for scan, without a corresponding input on the device, convert v refl . 2: the oax input is used if the corresponding op amp is selected (opmode (cmxcon<10>) = 1 ); otherwise, the anx input is used.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 334 ? 2011-2013 microchip technology inc. register 23-8: ad1cssl: adc1 input scan select register low ( 1 , 2 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 css15 css14 css13 css12 css11 css10 css9 css8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 css7 css6 css5 css4 css3 css2 css1 css0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 css<15:0>: adc input scan selection bits 1 = selects anx for input scan 0 = skips anx for input scan note 1: on devices with less than 16 analog inputs, all ad1cssl bits can be selected by the user. however, inputs selected for scan, without a corresponding input on the device, convert v refl . 2: cssx = anx, where x = 0-15.
? 2011-2013 microchip technology inc. ds70657g-page 335 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 24.0 peripheral trigger generator (ptg) module 24.1 module introduction the peripheral trigger generator (ptg) provides a means to schedule complex high-speed peripheral operations that would be difficult to achieve using soft- ware. the ptg module uses 8-bit commands, called ?steps?, that the user writes to the ptg queue regis- ters (ptgque0-ptque7), which perform operations, such as wait for input signal, generate output trigger and wait for timer. the ptg module has the following major features: ? multiple clock sources ? two 16-bit general purpose timers ? two 16-bit general limit counters ? configurable for rising or falling edge triggering ? generates processor interrupts to include: - four configurable processor interrupts - interrupt on a step event in single-step mode - interrupt on a ptg watchdog timer time-out ? able to receive trigger signals from these peripherals: -adc -pwm - output compare - input capture - op amp/comparator -int2 ? able to trigger or synchronize to these peripherals: - watchdog timer - output compare - input capture -adc -pwm - op amp/comparator note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?section 32. peripheral trigger generator (ptg)? (ds70669) of the ?dspic33e/pic24e family refer- ence manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 336 ? 2011-2013 microchip technology inc. figure 24-1: pt g block diagram 16-bit data bus ptgqptr<4:0> command decoder ptghold ptgadj ptg watchdog timer (1) ptg control logic ptgwdtif ptg general purpose timerx ptg loop counter x clock inputs f p t ad t1clk t2clk t3clk ptgclk<2:0> ptgl0<15:0> ptgtxlim<15:0> ptgcxlim<15:0> ptgbte<15:0> ptgo0 ptgsdlim<15:0> ptg step delay timer pwm oc1 oc2 ic1 cmpx adc int2 ptgcon<15:0> ptg interrupts trigger outputs ad1chs0<15:0> step command step command ptgstepif trigger inputs ptgo31 ? ? ? ptg0if ptg3if ? ? ? step command step command f osc ? ptgdiv<4:0> ptgcst<15:0> note 1: this is a dedicated watchdog timer for the ptg module and is independent of the device watchdog timer. ptgque0 ptgque1 ptgque2 ptgque3 ptgque5 ptgque4 ptgque6 ptgque7
? 2011-2013 microchip technology inc. ds70657g-page 337 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 24.2 ptg resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 24.2.1 key resources ? section 32. ?peripheral trigger generator? (ds70669) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 338 ? 2011-2013 microchip technology inc. 24.3 ptg control registers register 24-1: ptgcst: ptg control/status register r/w-0 u-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 ptgen ? ptgsidl ptgtogl ?ptgswt ( 2 ) ptgssen ptgivis bit 15 bit 8 r/w-0 hs-0 u-0 u-0 u-0 u-0 r/w-0 ptgstrt ptgwdto ? ? ? ?ptgitm<1:0> ( 1 ) bit 7 bit 0 legend: hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ptgen: module enable bit 1 = ptg module is enabled 0 = ptg module is disabled bit 14 unimplemented: read as ? 0 ? bit 13 ptgsidl: ptg stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12 ptgtogl: ptg trig output toggle mode bit 1 = toggle state of the ptgox for each execution of the ptgtrig command 0 = each execution of the ptgtrig command will generate a single ptgox pulse determined by the value in the ptgpwdx bits bit 11 unimplemented: read as ? 0 ? bit 10 ptgswt: ptg software trigger bit ( 2 ) 1 = triggers the ptg module 0 = no action (clearing this bit will have no effect) bit 9 ptgssen: ptg enable single-step bit 1 = enables single-step mode 0 = disables single-step mode bit 8 ptgivis: ptg counter/timer visibility control bit 1 = reads of the ptgsdlim, ptgcxlim or ptgtxlim registers return the current values of their corresponding counter/timer registers (ptgsd, ptgcx, ptgtx) 0 = reads of the ptgsdlim, ptgcxlim or ptgtxlim registers return the value previously written to those limit registers bit 7 ptgstrt: ptg start sequencer bit 1 = starts to sequentially execute commands (continuous mode) 0 = stops executing commands bit 6 ptgwdto: ptg watchdog timer time-out status bit 1 = ptg watchdog timer has timed out 0 = ptg watchdog timer has not timed out. bit 5-2 unimplemented: read as ? 0 ? note 1: these bits apply to the ptgwhi and ptgwlo commands only. 2: this bit is only used with the ptgctrl step command software trigger option.
? 2011-2013 microchip technology inc. ds70657g-page 339 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 1-0 ptgitm<1:0>: ptg input trigger command operating mode bits ( 1 ) 11 = single level detect with step delay not executed on exit of command (regardless of the ptgctrl command) 10 = single level detect with step delay executed on exit of command 01 = continuous edge detect with step delay not executed on exit of command (regardless of the ptgctrl command) 00 = continuous edge detect with step delay executed on exit of command register 24-1: ptgcst: ptg contro l/status register (continued) note 1: these bits apply to the ptgwhi and ptgwlo commands only. 2: this bit is only used with the ptgctrl step command software trigger option.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 340 ? 2011-2013 microchip technology inc. register 24-2: ptgcon: ptg control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgclk<2:0> ptgdiv<4:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 ptgpwd<3:0> ? ptgwdt<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 ptgclk<2:0>: select ptg module clock source bits 111 = reserved 110 = reserved 101 = ptg module clock source will be t3clk 100 = ptg module clock source will be t2clk 011 = ptg module clock source will be t1clk 010 = ptg module clock source will be t ad 001 = ptg module clock source will be f osc 000 = ptg module clock source will be f p bit 12-8 ptgdiv<4:0>: ptg module clock prescaler (divider) bits 11111 = divide-by-32 11110 = divide-by-31 ? ? ? 00001 = divide-by-2 00000 = divide-by-1 bit 7-4 ptgpwd<3:0>: ptg trigger output pulse width bits 1111 = all trigger outputs are 16 ptg clock cycles wide 1110 = all trigger outputs are 15 ptg clock cycles wide ? ? ? 0001 = all trigger outputs are 2 ptg clock cycles wide 0000 = all trigger outputs are 1 ptg clock cycle wide bit 3 unimplemented: read as ? 0 ? bit 2-0 ptgwdt<2:0>: select ptg watchdog timer time-out count value bits 111 = watchdog timer will time-out after 512 ptg clocks 110 = watchdog timer will time-out after 256 ptg clocks 101 = watchdog timer will time-out after 128 ptg clocks 100 = watchdog timer will time-out after 64 ptg clocks 011 = watchdog timer will time-out after 32 ptg clocks 010 = watchdog timer will time-out after 16 ptg clocks 001 = watchdog timer will time-out after 8 ptg clocks 000 = watchdog timer is disabled
? 2011-2013 microchip technology inc. ds70657g-page 341 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 24-3: ptgbte: ptg bro adcast trigger enable register ( 1 , 2 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adcts4 adcts3 adcts2 adcts1 ic4tss ic3tss ic2tss ic1tss bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 oc4cs oc3cs oc2cs oc1cs oc4tss oc3tss oc2tss oc1tss bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 adcts4: sample trigger ptgo15 for adc bit 1 = generates trigger when the broadcast command is executed 0 = does not generate trigger when the broadcast command is executed bit 14 adcts3: sample trigger ptgo14 for adc bit 1 = generates trigger when the broadcast command is executed 0 = does not generate trigger when the broadcast command is executed bit 13 adcts2: sample trigger ptgo13 for adc bit 1 = generates trigger when the broadcast command is executed 0 = does not generate trigger when the broadcast command is executed bit 12 adcts1: sample trigger ptgo12 for adc bit 1 = generates trigger when the broadcast command is executed 0 = does not generate trigger when the broadcast command is executed bit 11 ic4tss: trigger/synchronization source for ic4 bit 1 = generates trigger/synchronization when the broadcast command is executed 0 = does not generate trigger/synchronization when the broadcast command is executed bit 10 ic3tss: trigger/synchronization source for ic3 bit 1 = generates trigger/synchronization when the broadcast command is executed 0 = does not generate trigger/synchronization when the broadcast command is executed bit 9 ic2tss: trigger/synchronization source for ic2 bit 1 = generates trigger/synchronization when the broadcast command is executed 0 = does not generate trigger/synchronization when the broadcast command is executed bit 8 ic1tss: trigger/synchronization source for ic1 bit 1 = generates trigger/synchronization when the broadcast command is executed 0 = does not generate trigger/synchronization when the broadcast command is executed bit 7 oc4cs: clock source for oc4 bit 1 = generates clock pulse when the broadcast command is executed 0 = does not generate clock pulse when the broadcast command is executed bit 6 oc3cs: clock source for oc3 bit 1 = generates clock pulse when the broadcast command is executed 0 = does not generate clock pulse when the broadcast command is executed bit 5 oc2cs: clock source for oc2 bit 1 = generates clock pulse when the broadcast command is executed 0 = does not generate clock pulse when the broadcast command is executed note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ). 2: this register is only used with the ptgctrl option = 1111 step command.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 342 ? 2011-2013 microchip technology inc. bit 4 oc1cs: clock source for oc1 bit 1 = generates clock pulse when the broadcast command is executed 0 = does not generate clock pulse when the broadcast command is executed bit 3 oc4tss: trigger/synchronization source for oc4 bit 1 = generates trigger/synchronization when the broadcast command is executed 0 = does not generate trigger/synchronization when the broadcast command is executed bit 2 oc3tss: trigger/synchronization source for oc3 bit 1 = generates trigger/synchronization when the broadcast command is executed 0 = does not generate trigger/synchronization when the broadcast command is executed bit 1 oc2tss: trigger/synchronization source for oc2 bit 1 = generates trigger/synchronization when the broadcast command is executed 0 = does not generate trigger/synchronization when the broadcast command is executed bit 0 oc1tss: trigger/synchronization source for oc1 bit 1 = generates trigger/synchronization when the broadcast command is executed 0 = does not generate trigger/synchronization when the broadcast command is executed register 24-3: ptgbte: ptg bro adcast trigger enable register ( 1 , 2 ) (continued) note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ). 2: this register is only used with the ptgctrl option = 1111 step command.
? 2011-2013 microchip technology inc. ds70657g-page 343 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 24-4: ptgt0lim: ptg timer0 limit register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgt0lim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgt0lim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgt0lim<15:0>: ptg timer0 limit register bits general purpose timer0 limit register (effective only with a ptgt0 step command). note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-5: ptgt1lim: ptg timer1 limit register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgt1lim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgt1lim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgt1lim<15:0>: ptg timer1 limit register bits general purpose timer1 limit register (effective only with a ptgt1 step command). note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 344 ? 2011-2013 microchip technology inc. register 24-6: ptgsdlim: ptg step delay limit register ( 1 , 2 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgsdlim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgsdlim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgsdlim<15:0>: ptg step delay limit register bits holds a ptg step delay value representing the number of additional ptg clocks between the start of a step command and the completion of a step command. note 1: a base step delay of one ptg clock is added to any value written to the ptgsdlim register (step delay = (ptgsdlim) + 1). 2: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-7: ptgc0lim: ptg counter 0 limit register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgc0lim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgc0lim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgc0lim<15:0>: ptg counter 0 limit register bits may be used to specify the loop count for the ptgjmpc0 step command or as a limit register for the general purpose counter 0. note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ).
? 2011-2013 microchip technology inc. ds70657g-page 345 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 24-8: ptgc1lim: ptg counter 1 limit register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgc1lim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgc1lim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgc1lim<15:0>: ptg counter 1 limit register bits may be used to specify the loop count for the ptgjmpc1 step command or as a limit register for the general purpose counter 1. note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-9: ptghold: ptg hold register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptghold<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptghold<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptghold<15:0>: ptg general purpose hold register bits holds user-supplied data to be copied to the ptgtxlim, ptgcxlim, ptgsdlim or ptgl0 registers with the ptgcopy command. note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 346 ? 2011-2013 microchip technology inc. register 24-10: ptgadj: ptg adjust register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgadj<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgadj<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgadj<15:0>: ptg adjust register bits this register holds user-supplied data to be added to the ptgtxlim, ptgcxlim, ptgsdlim or ptgl0 registers with the ptgadd command. note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-11: ptgl0: ptg literal 0 register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgl0<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgl0<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgl0<15:0>: ptg literal 0 register bits this register holds the 16-bit value to be written to the ad1chs0 register with the ptgctrl step command. note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ).
? 2011-2013 microchip technology inc. ds70657g-page 347 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 24-12: ptgqptr: ptg step queue pointer register ( 1 ) u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ?ptgqptr<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 unimplemented: read as ? 0 ? bit 4-0 ptgqptr<4:0>: ptg step queue pointer register bits this register points to the currently active step command in the step queue. note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-13: ptgquex: ptg step queue register x (x = 0-7) ( 1 , 3 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 step(2x + 1)<7:0> ( 2 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 step(2x)<7:0> ( 2 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 step(2x + 1)<7:0>: ptg step queue pointer register bits ( 2 ) a queue location for storage of the step(2x + 1) command byte. bit 7-0 step(2x)<7:0>: ptg step queue pointer register bits ( 2 ) a queue location for storage of the step(2x) command byte. note 1: this register is read-only when the ptg module is executing step commands (ptgen = 1 and ptgstrt = 1 ). 2: refer to table 24-1 for the step command encoding. 3: the step registers maintain their values on any type of reset.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 348 ? 2011-2013 microchip technology inc. 24.4 step commands and format table 24-1: ptg step command format step command byte: stepx<7:0> cmd<3:0> option<3:0> bit 7 bit 4 bit 3 bit 0 bit 7-4 cmd<3:0> step command command description 0000 ptgctrl execute control command as described by option<3:0>. 0001 ptgadd add contents of ptgadj register to target register as described by option<3:0>. ptgcopy copy contents of ptghold register to target register as described by option<3:0>. 001x ptgstrb copy the value contained in cmd<0>:option<3:0> to the ch0sa<4:0> bits (ad1chs0<4:0>). 0100 ptgwhi wait for a low-to-high edge input from the selected ptg trigger input as described by option<3:0>. 0101 ptgwlo wait for a high-to-low edge input from the selected ptg trigger input as described by option<3:0>. 0110 reserved reserved. 0111 ptgirq generate individual interrupt request as described by option3<:0>. 100x ptgtrig generate individual trigger output as described by <:option<3:0>>. 101x ptgjmp copy the value indicated in <:option<3:0>> to the queue pointer (ptgqptr) and jump to that step queue. 110x ptgjmpc0 ptgc0 = ptgc0lim: increment the queue pointer (ptgqptr). ptgc0 ? ptgc0lim: increment counter 0 (ptgc0) and copy the value indicated in <:option<3:0>> to the queue pointer (ptgqptr), and jump to that step queue 111x ptgjmpc1 ptgc1 = ptgc1lim: increment the queue pointer (ptgqptr). ptgc1 ? ptgc1lim: increment counter 1 (ptgc1) and copy the value indicated in <:option<3:0>> to the queue pointer (ptgqptr), and jump to that step queue. note 1: all reserved commands or options will execute but have no effect (i.e., execute as a nop instruction). 2: refer to table 24-2 for the trigger output descriptions. 3: this feature is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices.
? 2011-2013 microchip technology inc. ds70657g-page 349 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 24-1: ptg step command format (continued) bit 3-0 step command option<3:0> option description ptgctrl ( 1 ) 0000 reserved. 0001 reserved. 0010 disable step delay timer (ptgsd). 0011 reserved. 0100 reserved. 0101 reserved. 0110 enable step delay timer (ptgsd). 0111 reserved. 1000 start and wait for the ptg timer0 to match the timer0 limit register. 1001 start and wait for the ptg timer1 to match the timer1 limit register. 1010 reserved. 1011 wait for the software trigger bit transition from low-to-high before continuing (ptgswt = 0 to 1 ). 1100 copy contents of the counter 0 register to the ad1chs0 register. 1101 copy contents of the counter 1 register to the ad1chs0 register. 1110 copy contents of the literal 0 register to the ad1chs0 register. 1111 generate triggers indicated in the broadcast trigger enable register (ptgbte). ptgadd ( 1 ) 0000 add contents of the ptgadj register to the counter 0 limit register (ptgc0lim). 0001 add contents of the ptgadj register to the counter 1 limit register (ptgc1lim). 0010 add contents of the ptgadj register to the timer0 limit register (ptgt0lim). 0011 add contents of the ptgadj register to the timer1 limit register (ptgt1lim). 0100 add contents of the ptgadj register to the step delay limit register (ptgsdlim). 0101 add contents of the ptgadj register to the literal 0 register (ptgl0). 0110 reserved. 0111 reserved. ptgcopy ( 1 ) 1000 copy contents of the ptghold register to the counter 0 limit register (ptgc0lim). 1001 copy contents of the ptghold register to the counter 1 limit register (ptgc1lim). 1010 copy contents of the ptghold register to the timer0 limit register (ptgt0lim). 1011 copy contents of the ptghold register to the timer1 limit register (ptgt1lim). 1100 copy contents of the ptghold register to the step delay limit register (ptgsdlim). 1101 copy contents of the ptghold register to the literal 0 register (ptgl0). 1110 reserved. 1111 reserved. note 1: all reserved commands or options will execute but have no effect (i.e., execute as a nop instruction). 2: refer to table 24-2 for the trigger output descriptions. 3: this feature is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 350 ? 2011-2013 microchip technology inc. table 24-1: ptg step command format (continued) bit 3-0 step command option<3:0> option description ptgwhi ( 1 ) or ptgwlo ( 1 ) 0000 pwm special event trigger. ( 3 ) 0001 pwm master time base synchronization output. ( 3 ) 0010 pwm1 interrupt. ( 3 ) 0011 pwm2 interrupt. ( 3 ) 0100 pwm3 interrupt. ( 3 ) 0101 reserved. 0110 reserved. 0111 oc1 trigger event. 1000 oc2 trigger event. 1001 ic1 trigger event. 1010 cmp1 trigger event. 1011 cmp2 trigger event. 1100 cmp3 trigger event. 1101 cmp4 trigger event. 1110 adc conversion done interrupt. 1111 int2 external interrupt. ptgirq ( 1 ) 0000 generate ptg interrupt 0. 0001 generate ptg interrupt 1. 0010 generate ptg interrupt 2. 0011 generate ptg interrupt 3. 0100 reserved. ? ? ? ? ? ? 1111 reserved. ptgtrig ( 2 ) 00000 ptgo0. 00001 ptgo1. ? ? ? ? ? ? 11110 ptgo30. 11111 ptgo31. note 1: all reserved commands or options will execute but have no effect (i.e., execute as a nop instruction). 2: refer to table 24-2 for the trigger output descriptions. 3: this feature is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices.
? 2011-2013 microchip technology inc. ds70657g-page 351 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 24-2: ptg output descriptions ptg output number ptg output description ptgo0 trigger/synchronization source for oc1 ptgo1 trigger/synchronization source for oc2 ptgo2 trigger/synchronization source for oc3 ptgo3 trigger/synchronization source for oc4 ptgo4 clock source for oc1 ptgo5 clock source for oc2 ptgo6 clock source for oc3 ptgo7 clock source for oc4 ptgo8 trigger/synchronization source for ic1 ptgo9 trigger/synchronization source for ic2 ptgo10 trigger/synchronization source for ic3 ptgo11 trigger/synchronization source for ic4 ptgo12 sample trigger for adc ptgo13 sample trigger for adc ptgo14 sample trigger for adc ptgo15 sample trigger for adc ptgo16 pwm time base synchronous source for pwm ( 1 ) ptgo17 pwm time base synchronous source for pwm ( 1 ) ptgo18 mask input select for op amp/comparator ptgo19 mask input select for op amp/comparator ptgo20 reserved ptgo21 reserved ptgo22 reserved ptgo23 reserved ptgo24 reserved ptgo25 reserved ptgo26 reserved ptgo27 reserved ptgo28 reserved ptgo29 reserved ptgo30 ptg output to pps input selection ptgo31 ptg output to pps input selection note 1: this feature is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 352 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 353 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 25.0 op amp/comparator module the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices contain up to four comparators, which can be configured in various ways. comparators, cmp1, cmp2 and cmp3, also have the option to be configured as op amps, with the output being brought to an external pin for gain/filtering connections. as shown in figure 25-1 , individual comparator options are specified by the comparator module?s special function register (sfr) control bits. these options allow users to: ? select the edge for trigger and interrupt generation ? configure the comparator voltage reference ? configure output blanking and masking ? configure as a comparator or op amp (cmp1, cmp2 and cmp3 only) figure 25-1: op amp/comparator x module bl ock diagram (modules 1, 2 and 3) note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 26. ?op amp/ comparator? (ds70357) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: op amp/comparator 3 is not available on the dspic33epxxxgp502/mc502/mc202 and pic24ep256gp/mc202 (28-pin) devices. note: not all op amp/comparator input/output connections are available on all devices. see the ?pin diagrams? section for available connections. blanking function digital filter cxout (1) (see figure 25-4 ) (see figure 25-5 ) ptg trigger input 0 1 00 01 cxin1+ cv refin (1) cxin1- c x in2- (1) note 1: this input/output is not available as a selection when configured as an op amp (opmode (cmxcon<10>) = 1 ). 2: this module can be configured either as an op amp or a comparator using the opmode bit. 3: when configured as an op amp (opmode = 1 ), the adc samples the op amp output; otherwise, the adc samples the anx pin. cmpx ? + v in - v in + cch<1:0> (cmxcon<1:0>) cref (cmxcon<4>) op amp/comparator (2) op ampx ? + oax/anx (3) oaxout/anx opmode (cmxcon<10>) (to adc) r int
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 354 ? 2011-2013 microchip technology inc. figure 25-2: compar ator module block diagram (module 4) figure 25-3: op amp/comparator voltage reference block diagram cmp4 blanking function digital filter (see figure 25-4 ) (see figure 25-5 ) ? + v in + c4out trigger output c4in1+ cv refin v in - 1 0 11 00 cch<1:0> (cm4con<1:0>) oa3/an6 c4in1- cref (cmxcon<4>) 01 10 oa1/an3 oa2/an0 8r r cvren cvrss = 0 av dd v ref + cvrss = 1 8r r r r r r r 16 steps cvrr cv ref 1 o cvr3 cvr2 cvr1 cvr0 cvrcon<3:0> av ss cv rsrc cvr1oe cv refin vrefsel cv ref 2 o (1) cvr2oe note 1: this reference is (av dd + av ss )/2. av ss av dd 1 0 16-to-1 mux (cvrcon<6>) (cvrcon<14>) (cvrcon<10>)
? 2011-2013 microchip technology inc. ds70657g-page 355 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 25-4: user-programmable blanking function block diagram figure 25-5: digital filter interconnect block diagram selsrca<3:0> selsrcb<3:0> selsrcc<3:0> and cmxmskcon mux a mai mbi mci comparator output to digital signals filter or blanking blanking blanking signals signals andi mask ?and-or? function hlms mux b mux c blanking logic (cmxmskcon<15) (cmxmsksrc<11:8) (cmxmsksrc<7:4) (cmxmsksrc<3:0>) mbi mci mai mbi mci mai c x out cfltren digital filter txclk (1,2) synco1 (3) f p (4) f osc (4) cfsel<2:0> ? ? cfdiv note 1: see the type c timer block diagram ( figure 13-2 ). 2: see the type b timer block diagram ( figure 13-1 ). 3: see the high-speed pwmx module register interconnection diagram ( figure 16-2 ). 4: see the oscillator system diagram ( figure 9-1 ). from blanking logic 1xx 010 000 001 1 0 (cm xfltr<6:4>) (cm xfltr<3>)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 356 ? 2011-2013 microchip technology inc. 25.1 op amp application considerations there are two configurations to take into consider- ation when designing with the op amp modules that are available in the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/ mc20x devices. configuration a (see figure 25-6 ) takes advantage of the internal connection to the adc module to route the output of the op amp directly to the adc for measurement. configuration b (see figure 25-7 ) requires that the designer externally route the output of the op amp (oaxout) to a separate ana- log input pin (any) on the device. table 30-55 in section 30.0 ?electrical characteristics? describes the performance characteristics for the op amps, distin- guishing between the two configuration types where applicable. 25.1.1 op amp configuration a figure 25-6 shows a typical inverting amplifier circuit taking advantage of the internal connections from the op amp output to the input of the adc. the advantage of this configuration is that the user does not need to con- sume another analog input (any) on the device, and allows the user to simultaneously sample all three op amps with the adc module, if needed. however, the presence of the internal resistance, r int 1, adds an error in the feedback path. since r int 1 is an internal resis- tance, in relation to the op amp output (v oa x out ) and adc internal connection (v adc ), r int 1 must be included in the numerator term of the transfer function. see table 30-53 in section 30.0 ?electrical characteris- tics? for the typical value of r int 1. table 30-60 and table 30-61 in section 30.0 ?electrical characteris- tics? describe the minimum sample time (t samp ) requirements for the adc module in this configuration. figure 25-6 also defines the equations that should be used when calculating the expected voltages at points, v adc and v oaxout . figure 25-6: op amp configuration a ? + cxin1- cxin1+ r 1 adc (3) oaxout r int 1 (1) r feedback (2) oax (to adc) op ampx note 1: see table 30-53 for the typical value. 2: see table 30-53 for the minimum value for the feedback resistor. 3: see table 30-60 and table 30-61 for the minimum sample time (t samp ). 4: cv ref1o or cv ref2o are two options that are available for supplying bias voltage to the op amps. v in v adc (v oa x out ) v oaxout r feedback r 1 ----------------------------- - ?? ?? bias voltage v ? in ?? = v adc r feedback r int 1 + r 1 -------------------------------------------------- - ?? ?? bias voltage v ? in ?? = bias voltage (4)
? 2011-2013 microchip technology inc. ds70657g-page 357 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 25.1.2 op amp configuration b figure 25-7 shows a typical inverting amplifier circuit with the output of the op amp (oaxout) externally routed to a separate analog input pin (any) on the device. this op amp configuration is slightly different in terms of the op amp output and the adc input connection, therefore, r int 1 is not included in the transfer function. however, this configuration requires the designer to externally route the op amp output (oaxout) to another analog input pin (any). see table 30-53 in section 30.0 ?electrical characteris- tics? for the typical value of r int 1. table 30-60 and table 30-61 in section 30.0 ?electrical characteris- tics? describe the minimum sample time (t samp ) requirements for the adc module in this configuration. figure 25-7 also defines the equation to be used to calculate the expected voltage at point v oa x out . this is the typical inverting amplifier equation. 25.2 op amp/comparator resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 25.2.1 key resources ? section 26. ?op amp/comparator? (ds70357) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools figure 25-7: op amp configuration b note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464 adc (3) oaxout r feedback (2) any note 1: see table 30-53 for the typical value. 2: see table 30-53 for the minimum value for the feedback resistor. 3: see table 30-60 and table 30-61 for the minimum sample time (t samp ). 4: cv ref1o or cv ref2o are two options that are available for supplying bias voltage to the op amps. ? + op ampx (v oa x out ) r int 1 (1) v oaxout r feedback r 1 ----------------------------- - ?? ?? bias voltage v ? in ?? = cxin1- cxin1+ r 1 v in bias voltage (4)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 358 ? 2011-2013 microchip technology inc. 25.3 op amp/comparator registers register 25-1: cmstat: op amp/comparator status register r/w-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 psidl ? ? ?c4evt ( 1 ) c3evt ( 1 ) c2evt ( 1 ) c1evt ( 1 ) bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ?c4out ( 2 ) c3out ( 2 ) c2out ( 2 ) c1out ( 2 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 psidl: comparator stop in idle mode bit 1 = discontinues operation of all comparators when device enters idle mode 0 = continues operation of all comparators in idle mode bit 14-12 unimplemented: read as ? 0 ? bit 11 c4evt: op amp/comparator 4 event status bit ( 1 ) 1 = op amp/comparator event occurred 0 = op amp/comparator event did not occur bit 10 c3evt: comparator 3 event status bit ( 1 ) 1 = comparator event occurred 0 = comparator event did not occur bit 9 c2evt: comparator 2 event status bit ( 1 ) 1 = comparator event occurred 0 = comparator event did not occur bit 8 c1evt: comparator 1 event status bit ( 1 ) 1 = comparator event occurred 0 = comparator event did not occur bit 7-4 unimplemented: read as ? 0 ? bit 3 c4out: comparator 4 output status bit ( 2 ) when cpol = 0 : 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 : 1 = v in + < v in - 0 = v in + > v in - bit 2 c3out: comparator 3 output status bit ( 2 ) when cpol = 0 : 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 : 1 = v in + < v in - 0 = v in + > v in - note 1: reflects the value of the of the cevt bit in the respective op amp/comparator control register, cmxcon<9>. 2: reflects the value of the cout bit in the respective op amp/comparator control register, cmxcon<8>.
? 2011-2013 microchip technology inc. ds70657g-page 359 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 1 c2out: comparator 2 output status bit ( 2 ) when cpol = 0 : 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 : 1 = v in + < v in - 0 = v in + > v in - bit 0 c1out: comparator 1 output status bit ( 2 ) when cpol = 0 : 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 : 1 = v in + < v in - 0 = v in + > v in - register 25-1: cmstat: op amp/compa rator status register (continued) note 1: reflects the value of the of the cevt bit in the respective op amp/comparator control register, cmxcon<9>. 2: reflects the value of the cout bit in the respective op amp/comparator control register, cmxcon<8>.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 360 ? 2011-2013 microchip technology inc. register 25-2: cmxcon: comparator x co ntrol register (x = 1, 2 or 3) r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 con coe cpol ? ? opmode cevt cout bit 15 bit 8 r/w-0 r/w-0 u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 evpol<1:0> ?cref ( 1 ) ? ? cch<1:0> ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 con: op amp/comparator enable bit 1 = op amp/comparator is enabled 0 = op amp/comparator is disabled bit 14 coe: comparator output enable bit 1 = comparator output is present on the cxout pin 0 = comparator output is internal only bit 13 cpol: comparator output polarity select bit 1 = comparator output is inverted 0 = comparator output is not inverted bit 12-11 unimplemented: read as ? 0 ? bit 10 opmode: op amp/comparator operation mode select bit 1 = circuit operates as an op amp 0 = circuit operates as a comparator bit 9 cevt: comparator event bit 1 = comparator event according to the evpol<1:0> settings occurred; disables future triggers and interrupts until the bit is cleared 0 = comparator event did not occur bit 8 cout: comparator output bit when cpol = 0 (non-inverted polarity): 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 (inverted polarity): 1 = v in + < v in - 0 = v in + > v in - note 1: inputs that are selected and not available will be tied to v ss . see the ?pin diagrams? section for available inputs for each package. 2: this input is not available when opmode (cmxcon<10>) = 1 .
? 2011-2013 microchip technology inc. ds70657g-page 361 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 7-6 evpol<1:0>: trigger/event/interrupt polarity select bits 11 = trigger/event/interrupt generated on any change of the comparator output (while cevt = 0 ) 10 = trigger/event/interrupt generated only on high-to-l ow transition of the polarity selected comparator output (while cevt = 0 ) if cpol = 1 (inverted polarity): low-to-high transition of the comparator output. if cpol = 0 (non-inverted polarity): high-to-low transition of the comparator output. 01 = trigger/event/interrupt generated only on low-to-h igh transition of the polarity-selected comparator output (while cevt = 0 ) if cpol = 1 (inverted polarity): high-to-low transition of the comparator output. if cpol = 0 (non-inverted polarity): low-to-high transition of the comparator output 00 = trigger/event/interrupt generation is disabled bit 5 unimplemented: read as ? 0 ? bit 4 cref: comparator reference select bit (v in + input) ( 1 ) 1 = v in + input connects to internal cv refin voltage ( 2 ) 0 = v in + input connects to cxin1+ pin bit 3-2 unimplemented: read as ? 0 ? bit 1-0 cch<1:0>: op amp/comparator channel select bits ( 1 ) 11 = unimplemented 10 = unimplemented 01 = inverting input of the comparator connects to the cxin2- pin ( 2 ) 00 = inverting input of the op amp/comparator connects to the cxin1- pin register 25-2: cmxcon: compara tor x control register (x = 1, 2 or 3) (continued) note 1: inputs that are selected and not available will be tied to v ss . see the ?pin diagrams? section for available inputs for each package. 2: this input is not available when opmode (cmxcon<10>) = 1 .
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 362 ? 2011-2013 microchip technology inc. register 25-3: cm4con: comp arator 4 control register r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 r/w-0 con coe cpol ? ? ?cevtcout bit 15 bit 8 r/w-0 r/w-0 u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 evpol<1:0> ?cref ( 1 ) ? ? cch<1:0> ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 con: comparator enable bit 1 = comparator is enabled 0 = comparator is disabled bit 14 coe: comparator output enable bit 1 = comparator output is present on the cxout pin 0 = comparator output is internal only bit 13 cpol: comparator output polarity select bit 1 = comparator output is inverted 0 = comparator output is not inverted bit 12-10 unimplemented: read as ? 0 ? bit 9 cevt: comparator event bit 1 = comparator event according to evpol<1:0> settings occurred; disables future triggers and interrupts until the bit is cleared 0 = comparator event did not occur bit 8 cout: comparator output bit when cpol = 0 (non-inverted polarity): 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 (inverted polarity): 1 = v in + < v in - 0 = v in + > v in - bit 7-6 evpol<1:0>: trigger/event/interrupt polarity select bits 11 = trigger/event/interrupt generated on any change of the comparator output (while cevt = 0 ) 10 = trigger/event/interrupt generated only on high-to-low transition of the polarity selected comparator output (while cevt = 0 ) if cpol = 1 (inverted polarity): low-to-high transition of the comparator output. if cpol = 0 (non-inverted polarity): high-to-low transition of the comparator output. 01 = trigger/event/interrupt generated only on low-to-hi gh transition of the polarity selected comparator output (while cevt = 0 ) if cpol = 1 (inverted polarity): high-to-low transition of the comparator output. if cpol = 0 (non-inverted polarity): low-to-high transition of the comparator output. 00 = trigger/event/interrupt generation is disabled note 1: inputs that are selected and not available will be tied to v ss . see the ?pin diagrams? section for available inputs for each package.
? 2011-2013 microchip technology inc. ds70657g-page 363 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 5 unimplemented: read as ? 0 ? bit 4 cref: comparator reference select bit (v in + input) ( 1 ) 1 = v in + input connects to internal cv refin voltage 0 = v in + input connects to c4in1+ pin bit 3-2 unimplemented: read as ? 0 ? bit 1-0 cch<1:0>: comparator channel select bits ( 1 ) 11 = v in - input of comparator connects to oa3/an6 10 = v in - input of comparator connects to oa2/an0 01 = v in - input of comparator connects to oa1/an3 00 = v in - input of comparator connects to c4in1- register 25-3: cm4con: comparator 4 control register (continued) note 1: inputs that are selected and not available will be tied to v ss . see the ?pin diagrams? section for available inputs for each package.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 364 ? 2011-2013 microchip technology inc. register 25-4: cmxmsksrc: comparator x mask source select control register u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 rw-0 ? ? ? ? selsrcc<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 selsrcb<3:0> selsrca<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-8 selsrcc<3:0>: mask c input select bits 1111 = flt4 1110 = flt2 1101 = ptgo19 1100 = ptgo18 1011 = reserved 1010 = reserved 1001 = reserved 1000 = reserved 0111 = reserved 0110 = reserved 0101 = pwm3h 0100 = pwm3l 0011 = pwm2h 0010 = pwm2l 0001 = pwm1h 0000 = pwm1l bit 7-4 selsrcb<3:0>: mask b input select bits 1111 = flt4 1110 = flt2 1101 = ptgo19 1100 = ptgo18 1011 = reserved 1010 = reserved 1001 = reserved 1000 = reserved 0111 = reserved 0110 = reserved 0101 = pwm3h 0100 = pwm3l 0011 = pwm2h 0010 = pwm2l 0001 = pwm1h 0000 = pwm1l
? 2011-2013 microchip technology inc. ds70657g-page 365 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 3-0 selsrca<3:0>: mask a input select bits 1111 = flt4 1110 = flt2 1101 = ptgo19 1100 = ptgo18 1011 = reserved 1010 = reserved 1001 = reserved 1000 = reserved 0111 = reserved 0110 = reserved 0101 = pwm3h 0100 = pwm3l 0011 = pwm2h 0010 = pwm2l 0001 = pwm1h 0000 = pwm1l register 25-4: cmxmsksrc: comparator x mask source select control register (continued)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 366 ? 2011-2013 microchip technology inc. register 25-5: cmxmskcon: comparator x mask gating control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 hlms ? ocen ocnen oben obnen oaen oanen bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nags pags acen acnen aben abnen aaen aanen bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 hlms: high or low-level masking select bits 1 = the masking (blanking) function will prevent any asserted (? 0 ?) comparator signal from propagating 0 = the masking (blanking) function will prevent any asserted (? 1 ?) comparator signal from propagating bit 14 unimplemented: read as ? 0 ? bit 13 ocen: or gate c input enable bit 1 = mci is connected to or gate 0 = mci is not connected to or gate bit 12 ocnen: or gate c input inverted enable bit 1 = inverted mci is connected to or gate 0 = inverted mci is not connected to or gate bit 11 oben: or gate b input enable bit 1 = mbi is connected to or gate 0 = mbi is not connected to or gate bit 10 obnen: or gate b input inverted enable bit 1 = inverted mbi is connected to or gate 0 = inverted mbi is not connected to or gate bit 9 oaen: or gate a input enable bit 1 = mai is connected to or gate 0 = mai is not connected to or gate bit 8 oanen: or gate a input inverted enable bit 1 = inverted mai is connected to or gate 0 = inverted mai is not connected to or gate bit 7 nags: and gate output inverted enable bit 1 = inverted andi is connected to or gate 0 = inverted andi is not connected to or gate bit 6 pags: and gate output enable bit 1 = andi is connected to or gate 0 = andi is not connected to or gate bit 5 acen: and gate c input enable bit 1 = mci is connected to and gate 0 = mci is not connected to and gate bit 4 acnen: and gate c input inverted enable bit 1 = inverted mci is connected to and gate 0 = inverted mci is not connected to and gate
? 2011-2013 microchip technology inc. ds70657g-page 367 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x bit 3 aben: and gate b input enable bit 1 = mbi is connected to and gate 0 = mbi is not connected to and gate bit 2 abnen: and gate b input inverted enable bit 1 = inverted mbi is connected to and gate 0 = inverted mbi is not connected to and gate bit 1 aaen: and gate a input enable bit 1 = mai is connected to and gate 0 = mai is not connected to and gate bit 0 aanen: and gate a input inverted enable bit 1 = inverted mai is connected to and gate 0 = inverted mai is not connected to and gate register 25-5: cmxmskcon: comparator x mask gating control register (continued)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 368 ? 2011-2013 microchip technology inc. register 25-6: cmxfltr: comparat or x filter control register u-0 u-0 u-0 u-0 u-0 u-0 u-0 i-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? cfsel<2:0> cfltren cfdiv<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-4 cfsel<2:0>: comparator filter input clock select bits 111 = t5clk ( 1 ) 110 = t4clk ( 2 ) 101 = t3clk ( 1 ) 100 = t2clk ( 2 ) 011 = reserved 010 = synco1 ( 3 ) 001 = f osc ( 4 ) 000 = f p ( 4 ) bit 3 cfltren: comparator filter enable bit 1 = digital filter is enabled 0 = digital filter is disabled bit 2-0 cfdiv<2:0>: comparator filter clock divide select bits 111 = clock divide 1:128 110 = clock divide 1:64 101 = clock divide 1:32 100 = clock divide 1:16 011 = clock divide 1:8 010 = clock divide 1:4 001 = clock divide 1:2 000 = clock divide 1:1 note 1: see the type c timer block diagram ( figure 13-2 ). 2: see the type b timer block diagram ( figure 13-1 ). 3: see the high-speed pwmx module register interconnection diagram ( figure 16-2 ). 4: see the oscillator system diagram ( figure 9-1 ).
? 2011-2013 microchip technology inc. ds70657g-page 369 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 25-7: cvrcon: comparator vo ltage reference control register u-0 r/w-0 u-0 u-0 u-0 r/w-0 u-0 u-0 ?cvr2oe ( 1 ) ? ? ? vrefsel ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 cvren cvr1oe ( 1 ) cvrr cvrss cvr<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14 cvr2oe: comparator voltage reference 2 output enable bit ( 1 ) 1 = (a vdd ? av ss )/2 is connected to the cv ref2o pin 0 = (a vdd ? av ss )/2 is disconnected from the cv ref2o pin bit 13-11 unimplemented: read as ? 0 ? bit 10 vrefsel: comparator voltage reference select bit 1 = cv refin = v ref + 0 = cv refin is generated by the resistor network bit 9-8 unimplemented: read as ? 0 ? bit 7 cvren: comparator voltage reference enable bit 1 = comparator voltage reference circuit is powered on 0 = comparator voltage reference circuit is powered down bit 6 cvr1oe: comparator voltage reference 1 output enable bit ( 1 ) 1 = voltage level is output on the cv ref1o pin 0 = voltage level is disconnected from then cv ref1o pin bit 5 cvrr: comparator voltage reference range selection bit 1 = cv rsrc /24 step-size 0 = cv rsrc /32 step-size bit 4 cvrss: comparator voltage reference source selection bit 1 = comparator voltage reference source, cv rsrc = (v ref +) ? (a vss ) 0 = comparator voltage reference source, cv rsrc = av dd ? av ss bit 3-0 cvr<3:0> comparator voltage reference value selection 0 ? cvr<3:0> ? 15 bits when cvrr = 1 : cv refin = (cvr<3:0>/24) ? (cv rsrc ) when cvrr = 0 : cv refin = (cv rsrc /4) + (cvr<3:0>/32) ? (cv rsrc ) note 1: cvrxoe overrides the trisx and the anselx bit settings.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 370 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 371 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 26.0 programmable cyclic redundancy check (crc) generator the programmable crc generator offers the following features: ? user-programmable (up to 32nd order) polynomial crc equation ? interrupt output ? data fifo the programmable crc generator provides a hardware implemented method of quickly generating checksums for various networking and security applications. it offers the following features: ? user-programmable crc polynomial equation, up to 32 bits ? programmable shift direction (little or big-endian) ? independent data and polynomial lengths ? configurable interrupt output ? data fifo a simplified block diagram of the crc generator is shown in figure 26-1 . a simple version of the crc shift engine is shown in figure 26-2 . figure 26-1: crc block diagram note 1: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 27. ?program- mable cyclic redundancy check (crc)? (ds70346) of the ? dspic33e/ pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. variable fifo (4x32, 8x16 or 16x8) crcdath crcdatl shift buffer crc shift engine crcwdath crcwdatl lendian 1 0 crcisel 1 0 fifo empty event shift complete event set crcif 2 * f p shift clock
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 372 ? 2011-2013 microchip technology inc. figure 26-2: crc shift engine detail 26.1 overview the crc module can be programmed for crc polynomials of up to the 32nd order, using up to 32 bits. polynomial length, which reflects the highest exponent in the equation, is selected by the plen<4:0> bits (crccon2<4:0>). the crcxorl and crcxorh registers control which exponent terms are included in the equation. setting a particular bit includes that exponent term in the equation; functionally, this includes an xor operation on the corresponding bit in the crc engine. clearing the bit disables the xor. for example, consider two crc polynomials, one a 16-bit equation and the other a 32-bit equation: to program these polynomials into the crc generator, set the register bits as shown in table 26-1 . note that the appropriate positions are set to ? 1 ? to indicate that they are used in the equation (for example, x26 and x23). the 0 bit required by the equation is always xored; thus, x0 is a don?t care. for a poly- nomial of length n , it is assumed that the n th bit will always be used, regardless of the bit setting. therefore, for a polynomial length of 32, there is no 32nd bit in the crcxor register. table 26-1: crc setup examples for 16 and 32-bit polynomial 26.2 programmable crc resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 26.2.1 key resources ? section 27. ?programmable cyclic redundancy check (crc)? (ds70346) ? code samples ? application notes ? software libraries ? webinars ? all related ?dspic33e/pic24e family reference manual? sections ? development tools crcwdath crcwdatl bit 0 bit 1 bit n (2) x(1) (1) read/write bus shift buffer data bit 2 x(2) (1) x(n) (1) note 1: each xor stage of the shift engine is programmable. see text for details. 2: polynomial length n is determined by ([plen<4:0>] + 1). x16 + x12 + x5 + 1 and x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 crc control bits bit values 16-bit polynomial 32-bit polynomial plen<4:0> 01111 11111 x<31:16> 0000 0000 0000 000x 0000 0100 1100 0001 x<15:0> 0001 0000 0010 000x 0001 1101 1011 011x note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011-2013 microchip technology inc. ds70657g-page 373 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 26.3 programmable crc registers register 26-1: crccon1: c rc control register 1 r/w-0 u-0 r/w-0 r-0 r-0 r-0 r-0 r-0 crcen ? csidl vword<4:0> bit 15 bit 8 r-0 r-1 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 crcful crcmpt crcisel crcgo lendian ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 crcen: crc enable bit 1 = crc module is enabled 0 = crc module is disabled; all state machines, pointers and crcwdat/crcdat are reset, other sfrs are not reset bit 14 unimplemented: read as ? 0 ? bit 13 csidl: crc stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-8 vword<4:0>: pointer value bits indicates the number of valid words in the fifo. has a maximum value of 8 when plen<4:0> > 7 or 16 when plen<4:0> ?? 7. bit 7 crcful : fifo full bit 1 = fifo is full 0 = fifo is not full bit 6 crcmpt: fifo empty bit 1 = fifo is empty 0 = fifo is not empty bit 5 crcisel: crc interrupt selection bit 1 = interrupt on fifo is empty; final word of data is still shifting through crc 0 = interrupt on shift is complete and crcwdat results are ready bit 4 crcgo: start crc bit 1 = starts crc serial shifter 0 = crc serial shifter is turned off bit 3 lendian: data word little-endian configuration bit 1 = data word is shifted into the crc starting with the lsb (little endian) 0 = data word is shifted into the crc starting with the msb (big endian) bit 2-0 unimplemented: read as ? 0 ?
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 374 ? 2011-2013 microchip technology inc. register 26-2: crccon2: crc control register 2 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? dwidth<4:0> bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? plen<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-8 dwidth<4:0>: data width select bits these bits set the width of the data word (dwidth<4:0> + 1). bit 7-5 unimplemented: read as ? 0 ? bit 4-0 plen<4:0>: polynomial length select bits these bits set the length of the polynomial (polynomial length = plen<4:0> + 1).
? 2011-2013 microchip technology inc. ds70657g-page 375 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 26-3: crcxorh: crc xor po lynomial high register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 x<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 x<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 x<31:16>: xor of polynomial term x n enable bits register 26-4: crcxorl: crc xor polynomial low register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 x<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 x<7:1> ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-1 x<15:1>: xor of polynomial term x n enable bits bit 0 unimplemented: read as ? 0 ?
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 376 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 377 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 27.0 special features dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices include several features intended to maximize application flexibility and reliability, and minimize cost through elimination of external components. these are: ? flexible configuration ? watchdog timer (wdt) ? code protection and codeguard? security ? jtag boundary scan interface ? in-circuit serial programming? (icsp?) ? in-circuit emulation 27.1 configuration bits in dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices, the configuration bytes are implemented as volatile mem- ory. this means that configuration data must be programmed each time the device is powered up. configuration data is stored in at the top of the on-chip program memory space, known as the flash configura- tion bytes. their specific locations are shown in table 27-1 . the configuration data is automatically loaded from the flash configuration bytes to the proper configuration shadow registers during device resets. when creating applications for these devices, users should always specifically allocate the location of the flash configuration bytes for configuration data in their code for the compiler. this is to make certain that pro- gram code is not stored in this address when the code is compiled. the upper 2 bytes of all flash configuration words in program memory should always be ? 1111 1111 1111 1111 ?. this makes them appear to be nop instructions in the remote event that their locations are ever executed by accident. since configuration bits are not implemented in the corresponding locations, writing ? 1 ?s to these locations has no effect on device operation. the configuration flash bytes map is shown in table 27-1 . note: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the related section of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). note: configuration data is reloaded on all types of device resets. note: performing a page erase operation on the last page of program memory clears the flash configuration bytes, enabling code protection as a result. therefore, users should avoid performing page erase operations on the last page of program memory.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 378 ? 2011-2013 microchip technology inc. table 27-1: configuration byte register map file name address device memory size (kbytes) bits 23-8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved 0057ec 32 ? ? ? ? ? ? ? ? ? 00afec 64 0157ec 128 02afec 256 0557ec 512 reserved 0057ee 32 ? ? ? ? ? ? ? ? ? 00afee 64 0157ee 128 02afee 256 0557ee 512 ficd 0057f0 32 ? reserved ( 3 ) ? jtagen reserved ( 2 ) reserved ( 3 ) ?ics<1:0> 00aff0 64 0157f0 128 02aff0 256 0557f0 512 fpor 0057f2 32 ? wdtwin<1:0> alti2c2 alti2c1 reserved ( 3 ) ? ? ? 00aff2 64 0157f2 128 02aff2 256 0557f2 512 fwdt 0057f4 32 ? fwdten windis pllken wdtpre wdtpost<3:0> 00aff4 64 0157f4 128 02aff4 256 0557f4 512 fosc 0057f6 32 ? fcksm<1:0> iol1way ? ? osciofnc poscmd<1:0> 00aff6 64 0157f6 128 02aff6 256 0557f6 512 fosc- sel 0057f8 32 ? ieso pwmlock ( 1 ) ? ? ?fnosc<2:0> 00aff8 64 0157f8 128 02aff8 256 0557f8 512 fgs 0057fa 32 ? ? ? ? ? ? ? gcp gwrp 00affa 64 0157fa 128 02affa 256 0557fa 512 reserved 0057fc 32 ? ? ? ? ? ? ? ? ? 00affc 64 0157fc 128 02affc 256 0557fc 512 reserved 057ffe 32 ? ? ? ? ? ? ? ? ? 00affe 64 0157fe 128 02affe 256 0557fe 512 legend: ? = unimplemented, read as ? 1 ?. note 1: this bit is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices. 2: this bit is reserved and must be programmed as ? 0 ?. 3: these bits are reserved and must be programmed as ? 1 ?.
? 2011-2013 microchip technology inc. ds70657g-page 379 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 27-2: configuration bits description bit field description gcp general segment code-protect bit 1 = user program memory is not code-protected 0 = code protection is enabled for the entire program memory space gwrp general segment write-protect bit 1 = user program memory is not write-protected 0 = user program memory is write-protected ieso two-speed oscillator start-up enable bit 1 = start up device with frc, then automatically switch to the user-selected oscillator source when ready 0 = start up device with user-selected oscillator source pwmlock ( 1 ) pwm lock enable bit 1 = certain pwm registers may only be written after a key sequence 0 = pwm registers may be written without a key sequence fnosc<2:0> oscillator selection bits 111 = fast rc oscillator with divide-by-n (frcdivn) 110 = reserved; do not use 101 = low-power rc oscillator (lprc) 100 = reserved; do not use 011 = primary oscillator with pll module (xt + pll, hs + pll, ec + pll) 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator with divide-by-n with pll module (frcpll) 000 = fast rc oscillator (frc) fcksm<1:0> clock switching mode bits 1x = clock switching is disabled, fail-safe clock monitor is disabled 01 = clock switching is enabled, fail-safe clock monitor is disabled 00 = clock switching is enabled, fail-safe clock monitor is enabled iol1way peripheral pin select configuration bit 1 = allow only one reconfiguration 0 = allow multiple reconfigurations osciofnc osc2 pin function bit (except in xt and hs modes) 1 = osc2 is the clock output 0 = osc2 is a general purpose digital i/o pin poscmd<1:0> primary oscillator mode select bits 11 = primary oscillator is disabled 10 = hs crystal oscillator mode 01 = xt crystal oscillator mode 00 = ec (external clock) mode fwdten watchdog timer enable bit 1 = watchdog timer is always enabled (lprc oscillator cannot be disabled. clearing the swdten bit in the rcon register will have no effect.) 0 = watchdog timer is enabled/disabled by user software (lprc can be disabled by clearing the swdten bit in the rcon register) windis watchdog timer window enable bit 1 = watchdog timer in non-window mode 0 = watchdog timer in window mode pllken pll lock enable bit 1 = pll lock is enabled 0 = pll lock is disabled wdtpre watchdog timer prescaler bit 1 = 1:128 0 = 1:32 note 1: this bit is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 380 ? 2011-2013 microchip technology inc. wdtpost<3:0> watchdog timer postscaler bits 1111 = 1:32,768 1110 = 1:16,384 ? ? ? 0001 = 1:2 0000 = 1:1 wdtwin<1:0> watchdog window select bits 11 = wdt window is 25% of wdt period 10 = wdt window is 37.5% of wdt period 01 = wdt window is 50% of wdt period 00 = wdt window is 75% of wdt period alti2c1 alternate i2c1 pin 1 = i2c1 is mapped to the sda1/scl1 pins 0 = i2c1 is mapped to the asda1/ascl1 pins alti2c2 alternate i2c2 pin 1 = i2c2 is mapped to the sda2/scl2 pins 0 = i2c2 is mapped to the asda2/ascl2 pins jtagen jtag enable bit 1 = jtag is enabled 0 = jtag is disabled ics<1:0> icd communication channel select bits 11 = communicate on pgec1 and pged1 10 = communicate on pgec2 and pged2 01 = communicate on pgec3 and pged3 00 = reserved, do not use table 27-2: configuration bits description (continued) bit field description note 1: this bit is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices.
? 2011-2013 microchip technology inc. ds70657g-page 381 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x register 27-1: devid: device id register rrrrrrrr devid<23:16> ( 1 ) bit 23 bit 16 rrrrrrrr devid<15:8> ( 1 ) bit 15 bit 8 rrrrrrrr devid<7:0> ( 1 ) bit 7 bit 0 legend: r = read-only bit u = unimplemented bit bit 23-0 devid<23:0>: device identifier bits ( 1 ) note 1: refer to the ?dspic33e/pic24e flash programming specification for devices with volatile configuration bits? (ds70663) for the list of device id values. register 27-2: devrev: device revision register rrrrrrrr devrev<23:16> ( 1 ) bit 23 bit 16 rrrrrrrr devrev<15:8> ( 1 ) bit 15 bit 8 rrrrrrrr devrev<7:0> ( 1 ) bit 7 bit 0 legend: r = read-only bit u = unimplemented bit bit 23-0 devrev<23:0>: device revision bits ( 1 ) note 1: refer to the ?dspic33e/pic24e flash programming specification for devices with volatile configuration bits? (ds70663) for the list of device revision values.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 382 ? 2011-2013 microchip technology inc. 27.2 user id words dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices contain four user id words, located at addresses, 0x800ff8 through 0x800ffe. the user id words can be used for storing product information such as serial numbers, system manufacturing dates, manufacturing lot numbers and other application-specific information. the user id words register map is shown in table 27-3 . table 27-3: user id words register map 27.3 on-chip voltage regulator all the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/ mc20x devices power their core digital logic at a nominal 1.8v. this can create a conflict for designs that are required to operate at a higher typical voltage, such as 3.3v. to simplify system design, all devices in the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x family incorporate an on- chip regulator that allows the device to run its core logic from v dd . the regulator provides power to the core from the other v dd pins. a low-esr (less than 1 ohm) capacitor (such as tantalum or ceramic) must be connected to the v cap pin ( figure 27-1 ). this helps to maintain the stability of the regulator. the recommended value for the filter capacitor is provided in table 30-5 located in section 30.0 ?electrical characteristics? . figure 27-1: conne ctions for the on-chip voltage regulator ( 1 , 2 , 3 ) 27.4 brown-out reset (bor) the brown-out reset (bor) module is based on an internal voltage reference circuit that monitors the reg- ulated supply voltage, v cap . the main purpose of the bor module is to generate a device reset when a brown-out condition occurs. brown-out conditions are generally caused by glitches on the ac mains (for example, missing portions of the ac cycle waveform due to bad power transmission lines or voltage sags due to excessive current draw when a large inductive load is turned on). a bor generates a reset pulse, which resets the device. the bor selects the clock source, based on the device configuration bit values (fnosc<2:0> and poscmd<1:0>). if an oscillator mode is selected, the bor activates the oscillator start-up timer (ost). the system clock is held until ost expires. if the pll is used, the clock is held until the lock bit (osccon<5>) is ? 1 ?. concurrently, the pwrt time-out (t pwrt ) is applied before the internal reset is released. if t pwrt = 0 and a crystal oscillator is being used, then a nominal delay of t fscm is applied. the total delay in this case is t fscm . refer to parameter sy35 in table 30-22 of section 30.0 ?electrical characteristics? for specific t fscm values. the bor status bit (rcon<1>) is set to indicate that a bor has occurred. the bor circuit continues to oper- ate while in sleep or idle modes and resets the device should v dd fall below the bor threshold voltage. file name address bits 23-16 bits 15-0 fuid0 0x800ff8 ?uid0 fuid1 0x800ffa ?uid1 fuid2 0x800ffc ?uid2 fuid3 0x800ffe ?uid3 legend: ? = unimplemented, read as ? 1 ?. note: it is important for the low-esr capacitor to be placed as close as possible to the v cap pin. note 1: these are typical operating voltages. refer to table 30-5 located in section 30.1 ?dc characteristics? for the full operating ranges of v dd and v cap . 2: it is important for the low-esr capacitor to be placed as close as possible to the v cap pin. 3: typical v cap pin voltage = 1.8v when v dd v ddmin . v dd v cap v ss dspic33e/pic24e 3.3v c efc
? 2011-2013 microchip technology inc. ds70657g-page 383 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 27.5 watchdog timer (wdt) for dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices, the wdt is driven by the lprc oscillator. when the wdt is enabled, the clock source is also enabled. 27.5.1 prescaler/postscaler the nominal wdt clock source from lprc is 32 khz. this feeds a prescaler that can be configured for either 5-bit (divide-by-32) or 7-bit (divide-by-128) operation. the prescaler is set by the wdtpre configuration bit. with a 32 khz input, the prescaler yields a wdt time- out period (twdt), as shown in parameter sy12 in table 30-22 . a variable postscaler divides down the wdt prescaler output and allows for a wide range of time-out periods. the postscaler is controlled by the wdtpost<3:0> configuration bits (fwdt<3:0>), which allow the selection of 16 settings, from 1:1 to 1:32,768. using the prescaler and postscaler, time-out periods ranging from 1 ms to 131 seconds can be achieved. the wdt, prescaler and postscaler are reset: ? on any device reset ? on the completion of a clock switch, whether invoked by software (i.e., setting the oswen bit after changing the noscx bits) or by hardware (i.e., fail-safe clock monitor) ? when a pwrsav instruction is executed (i.e., sleep or idle mode is entered) ? when the device exits sleep or idle mode to resume normal operation ?by a clrwdt instruction during normal execution 27.5.2 sleep and idle modes if the wdt is enabled, it continues to run during sleep or idle modes. when the wdt time-out occurs, the device wakes the device and code execution continues from where the pwrsav instruction was executed. the corre- sponding sleep or idle bit (rcon<3,2>) needs to be cleared in software after the device wakes up. 27.5.3 enabling wdt the wdt is enabled or disabled by the fwdten configuration bit in the fwdt configuration register. when the fwdten configuration bit is set, the wdt is always enabled. the wdt can be optionally controlled in software when the fwdten configuration bit has been programmed to ? 0 ?. the wdt is enabled in software by setting the swdten control bit (rcon<5>). the swdten control bit is cleared on any device reset. the software wdt option allows the user application to enable the wdt for critical code segments and disable the wdt during non-critical segments for maximum power savings. the wdt flag bit, wdto (rcon<4>), is not automatically cleared following a wdt time-out. to detect subsequent wdt events, the flag must be cleared in software. 27.5.4 wdt window the watchdog timer has an optional windowed mode, enabled by programming the windis bit in the wdt configuration register (fwdt<6>). in the windowed mode (windis = 0 ), the wdt should be cleared based on the settings in the programmable watchdog timer window select bits (wdtwin<1:0>). figure 27-2: wdt block diagram note: the clrwdt and pwrsav instructions clear the prescaler and postscaler counts when executed. 0 1 wdtpre wdtpost<3:0> watchdog timer prescaler (divide-by-n1) postscaler (divide-by-n2) sleep/idle wdt wdt window select windis wdt clrwdt instruction swdten fwdten lprc clock rs rs wake-up reset wdtwin<1:0> all device resets transition to new clock source exit sleep or idle mode pwrsav instruction clrwdt instruction
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 384 ? 2011-2013 microchip technology inc. 27.6 jtag interface dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x devices implement a jtag interface, which supports boundary scan device testing. detailed information on this interface is provided in future revisions of the document. 27.7 in-circuit serial programming the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x and pic24epxxxgp/mc20x devices can be serially programmed while in the end application circuit. this is done with two lines for clock and data, and three other lines for power, ground and the programming sequence. serial programming allows customers to manufacture boards with unprogrammed devices and then program the device just before shipping the product. serial programming also allows the most recent firmware or a custom firmware to be programmed. refer to the ?dspic33e/pic24e flash programming specification for devices with volatile configuration bits? (ds70663) for details about in-circuit serial programming (icsp). any of the three pairs of programming clock/data pins can be used: ? pgec1 and pged1 ? pgec2 and pged2 ? pgec3 and pged3 27.8 in-circuit debugger when mplab ? icd 3 or real ice? is selected as a debugger, the in-circuit debugging functionality is enabled. this function allows simple debugging func- tions when used with mplab ide. debugging function- ality is controlled through the pgecx (emulation/ debug clock) and pgedx (emulation/debug data) pin functions. any of the three pairs of debugging clock/data pins can be used: ? pgec1 and pged1 ? pgec2 and pged2 ? pgec3 and pged3 to use the in-circuit debugger function of the device, the design must implement icsp connections to mclr , v dd , v ss and the pgecx/pgedx pin pair. in addition, when the feature is enabled, some of the resources are not available for general use. these resources include the first 80 bytes of data ram and two i/o pins (pgecx and pgedx). 27.9 code protection and codeguard? security the dspic33epxxxgp50x, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices offer basic implementation of codeguard security that supports only general segment (gs) security. this feature helps protect individual intellectual property. note: refer to section 24. ?programming and diagnostics? (ds70608) of the ?dspic33e/pic24e family reference manual? for further information on usage, configuration and operation of the jtag interface. note: refer to section 23. ?codeguard? security? (ds70634) of the ?dspic33e/ pic24e family reference manual? for further information on usage, configuration and operation of codeguard security.
? 2011-2013 microchip technology inc. ds70657g-page 385 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 28.0 instruction set summary the dspic33ep instruction set is almost identical to that of the dspic30f and dspic33f. the pic24ep instruction set is almost identical to that of the pic24f and pic24h. most instructions are a single program memory word (24 bits). only three instructions require two program memory locations. each single-word instruction is a 24-bit word, divided into an 8-bit opcode, which specifies the instruction type and one or more operands, which further specify the operation of the instruction. the instruction set is highly orthogonal and is grouped into five basic categories: ? word or byte-oriented operations ? bit-oriented operations ? literal operations ? dsp operations ? control operations table 28-1 lists the general symbols used in describing the instructions. the dspic33e instruction set summary in tab l e 2 8- 2 lists all the instructions, along with the status flags affected by each instruction. most word or byte-oriented w register instructions (including barrel shift instructions) have three operands: ? the first source operand, which is typically a register ?wb? without any address modifier ? the second source operand, which is typically a register ?ws? with or without an address modifier ? the destination of the result, which is typically a register ?wd? with or without an address modifier however, word or byte-oriented file register instructions have two operands: ? the file register specified by the value ?f? ? the destination, which could be either the file register ?f? or the w0 register, which is denoted as ?wreg? most bit-oriented instructions (including simple rotate/ shift instructions) have two operands: ? the w register (with or without an address modifier) or file register (specified by the value of ?ws? or ?f?) ? the bit in the w register or file register (specified by a literal value or indirectly by the contents of register ?wb?) the literal instructions that involve data movement can use some of the following operands: ? a literal value to be loaded into a w register or file register (specified by ?k?) ? the w register or file register where the literal value is to be loaded (specified by ?wb? or ?f?) however, literal instructions that involve arithmetic or logical operations use some of the following operands: ? the first source operand, which is a register ?wb? without any address modifier ? the second source operand, which is a literal value ? the destination of the result (only if not the same as the first source operand), which is typically a register ?wd? with or without an address modifier the mac class of dsp instructions can use some of the following operands: ? the accumulator (a or b) to be used (required operand) ? the w registers to be used as the two operands ? the x and y address space prefetch operations ? the x and y address space prefetch destinations ? the accumulator write back destination the other dsp instructions do not involve any multiplication and can include: ? the accumulator to be used (required) ? the source or destination operand (designated as wso or wdo, respectively) with or without an address modifier ? the amount of shift specified by a w register ?wn? or a literal value the control instructions can use some of the following operands: ? a program memory address ? the mode of the table read and table write instructions note: this data sheet summarizes the features of the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the related section of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 386 ? 2011-2013 microchip technology inc. most instructions are a single word. certain double-word instructions are designed to provide all the required information in these 48 bits. in the second word, the 8msbs are ? 0 ?s. if this second word is executed as an instruction (by itself), it executes as a nop . the double-word instructions execute in two instruction cycles. most single-word instructions are executed in a single instruction cycle, unless a conditional test is true, or the program counter is changed as a result of the instruction, or a psv or table read is performed, or an sfr register is read. in these cases, the execution takes multiple instruction cycles with the additional instruction cycle(s) executed as a nop . certain instructions that involve skipping over the subsequent instruction require either two or three cycles if the skip is performed, depending on whether the instruction being skipped is a single-word or two-word instruction. moreover, double-word moves require two cycles. note: for more details on the instruction set, refer to the ?16-bit mcu and dsc programmer?s reference manual? (ds70157). for more information on instructions that take more than one instruction cycle to execute, refer to section 2. ?cpu? of the ?dspic33e/pic24e family refer- ence manual? (ds70359), particularly section 2.8, ?instruction flow types? . table 28-1: symbols used in opcode descriptions field description #text means literal defined by ? text ? (text) means ?content of text ? [text] means ?the location addressed by text ? { } optional field or operation a ? {b, c, d} a is selected from the set of values b, c, d register bit field .b byte mode selection .d double-word mode selection .s shadow register select .w word mode selection (default) acc one of two accumulators {a, b} awb accumulator write back destination address register ?? {w13, [w13]+ = 2} bit4 4-bit bit selection field (used in word addressed instructions) ?? {0...15} c, dc, n, ov, z mcu status bits: carry, digit carry, negative, overflow, sticky zero expr absolute address, label or expression (resolved by the linker) f file register address ?? {0x0000...0x1fff} lit1 1-bit unsigned literal ?? {0,1} lit4 4-bit unsigned literal ?? {0...15} lit5 5-bit unsigned literal ?? {0...31} lit8 8-bit unsigned literal ?? {0...255} lit10 10-bit unsigned literal ?? {0...255} for byte mode, {0:1023} for word mode lit14 14-bit unsigned literal ?? {0...16384} lit16 16-bit unsigned literal ?? {0...65535} lit23 23-bit unsigned literal ?? {0...8388608}; lsb must be ? 0 ? none field does not require an entry, can be blank oa, ob, sa, sb dsp status bits: acca overflow, accb overflow, acca saturate, accb saturate pc program counter slit10 10-bit signed literal ?? {-512...511} slit16 16-bit signed literal ?? {-32768...32767} slit6 6-bit signed literal ?? {-16...16} wb base w register ?? {w0...w15} wd destination w register ?? { wd, [wd], [wd++], [wd--], [++wd], [--wd] } wdo destination w register ?? { wnd, [wnd], [wnd++], [wnd--], [++wnd], [--wnd], [wnd+wb] }
? 2011-2013 microchip technology inc. ds70657g-page 387 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x wm,wn dividend, divisor working r egister pair (direct addressing) wm*wm multiplicand and multiplier working r egister pair for square instructions ?? {w4 * w4,w5 * w5,w6 * w6,w7 * w7} wm*wn multiplicand and multiplier working register pair for dsp instructions ? {w4 * w5,w4 * w6,w4 * w7,w5 * w6,w5 * w7,w6 * w7} wn one of 16 working registers ?? {w0...w15} wnd one of 16 destination working registers ?? {w0...w15} wns one of 16 source working registers ?? {w0...w15} wreg w0 (working register used in file register instructions) ws source w register ?? { ws, [ws], [ws++], [ws--], [++ws], [--ws] } wso source w register ?? { wns, [wns], [wns++], [wns--], [++wns], [--wns], [wns+wb] } wx x data space prefetch address register for dsp instructions ? {[w8] + = 6, [w8] + = 4, [w8] + = 2, [w8], [w8] - = 6, [w8] - = 4, [w8] - = 2, [w9] + = 6, [w9] + = 4, [w9] + = 2, [w9], [w9] - = 6, [w9] - = 4, [w9] - = 2, [w9 + w12], none} wxd x data space prefetch destination register for dsp instructions ?? {w4...w7} wy y data space prefetch address register for dsp instructions ? {[w10] + = 6, [w10] + = 4, [w10] + = 2, [w10], [w10] - = 6, [w10] - = 4, [w10] - = 2, [w11] + = 6, [w11] + = 4, [w11] + = 2, [w11], [w11] - = 6, [w11] - = 4, [w11] - = 2, [w11 + w12], none} wyd y data space prefetch destination register for dsp instructions ?? {w4...w7} table 28-1: symbols used in opcode descriptions (continued) field description
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 388 ? 2011-2013 microchip technology inc. table 28-2: instruction set overview base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected 1 add add acc ( 1 ) add accumulators 1 1 oa,ob,sa,sb add f f = f + wreg 1 1 c,dc,n,ov,z add f,wreg wreg = f + wreg 1 1 c,dc,n,ov,z add #lit10,wn wd = lit10 + wd 1 1 c,dc,n,ov,z add wb,ws,wd wd = wb + ws 1 1 c,dc,n,ov,z add wb,#lit5,wd wd = wb + lit5 1 1 c,dc,n,ov,z add wso,#slit4,acc 16-bit signed add to accumulator 1 1 oa,ob,sa,sb 2 addc addc f f = f + wreg + (c) 1 1 c,dc,n,ov,z addc f,wreg wreg = f + wreg + (c) 1 1 c,dc,n,ov,z addc #lit10,wn wd = lit10 + wd + (c) 1 1 c,dc,n,ov,z addc wb,ws,wd wd = wb + ws + (c) 1 1 c,dc,n,ov,z addc wb,#lit5,wd wd = wb + lit5 + (c) 1 1 c,dc,n,ov,z 3 and and f f = f .and. wreg 1 1 n,z and f,wreg wreg = f .and. wreg 1 1 n,z and #lit10,wn wd = lit10 .and. wd 1 1 n,z and wb,ws,wd wd = wb .and. ws 1 1 n,z and wb,#lit5,wd wd = wb .and. lit5 1 1 n,z 4 asr asr f f = arithmetic right shift f 1 1 c,n,ov,z asr f,wreg wreg = arithmetic right shift f 1 1 c,n,ov,z asr ws,wd wd = arithmetic right shift ws 1 1 c,n,ov,z asr wb,wns,wnd wnd = arithmetic right shift wb by wns 1 1 n,z asr wb,#lit5,wnd wnd = arithmetic right shift wb by lit5 1 1 n,z 5 bclr bclr f,#bit4 bit clear f 1 1 none bclr ws,#bit4 bit clear ws 1 1 none 6 bra bra c,expr branch if carry 1 1 (4) none bra ge,expr branch if greater than or equal 1 1 (4) none bra geu,expr branch if unsigned greater than or equal 1 1 (4) none bra gt,expr branch if greater than 1 1 (4) none bra gtu,expr branch if unsigned greater than 1 1 (4) none bra le,expr branch if less than or equal 1 1 (4) none bra leu,expr branch if unsigned less than or equal 1 1 (4) none bra lt,expr branch if less than 1 1 (4) none bra ltu,expr branch if unsigned less than 1 1 (4) none bra n,expr branch if negative 1 1 (4) none bra nc,expr branch if not carry 1 1 (4) none bra nn,expr branch if not negative 1 1 (4) none bra nov,expr branch if not overflow 1 1 (4) none bra nz,expr branch if not zero 1 1 (4) none bra oa,expr ( 1 ) branch if accumulator a overflow 1 1 (4) none bra ob,expr ( 1 ) branch if accumulator b overflow 1 1 (4) none bra ov,expr ( 1 ) branch if overflow 1 1 (4) none bra sa,expr ( 1 ) branch if accumulator a saturated 1 1 (4) none bra sb,expr ( 1 ) branch if accumulator b saturated 1 1 (4) none bra expr branch unconditionally 1 4 none bra z,expr branch if zero 1 1 (4) none bra wn computed branch 1 4 none 7 bset bset f,#bit4 bit set f 1 1 none bset ws,#bit4 bit set ws 1 1 none 8 bsw bsw.c ws,wb write c bit to ws 1 1 none bsw.z ws,wb write z bit to ws 1 1 none note 1: these instructions are available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 389 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 9 btg btg f,#bit4 bit toggle f 1 1 none btg ws,#bit4 bit toggle ws 1 1 none 10 btsc btsc f,#bit4 bit test f, skip if clear 1 1 (2 or 3) none btsc ws,#bit4 bit test ws, skip if clear 1 1 (2 or 3) none 11 btss btss f,#bit4 bit test f, skip if set 1 1 (2 or 3) none btss ws,#bit4 bit test ws, skip if set 1 1 (2 or 3) none 12 btst btst f,#bit4 bit test f 1 1 z btst.c ws,#bit4 bit test ws to c 1 1 c btst.z ws,#bit4 bit test ws to z 1 1 z btst.c ws,wb bit test ws to c 1 1 c btst.z ws,wb bit test ws to z 1 1 z 13 btsts btsts f,#bit4 bit test then set f 1 1 z btsts.c ws,#bit4 bit test ws to c, then set 1 1 c btsts.z ws,#bit4 bit test ws to z, then set 1 1 z 14 call call lit23 call subroutine 2 4 sfa call wn call indirect subroutine 1 4 sfa call.l wn call indirect subroutine (long address) 1 4 sfa 15 clr clr f f = 0x0000 1 1 none clr wreg wreg = 0x0000 1 1 none clr ws ws = 0x0000 1 1 none clr acc,wx,wxd,wy,wyd,awb ( 1 ) clear accumulator 1 1 oa,ob,sa,sb 16 clrwdt clrwdt clear watchdog timer 1 1 wdto,sleep 17 com com f f = f 11 n,z com f,wreg wreg = f 11 n,z com ws,wd wd = ws 11 n,z 18 cp cp f compare f with wreg 1 1 c,dc,n,ov,z cp wb,#lit8 compare wb with lit8 1 1 c,dc,n,ov,z cp wb,ws compare wb with ws (wb ? ws) 1 1 c,dc,n,ov,z 19 cp0 cp0 f compare f with 0x0000 1 1 c,dc,n,ov,z cp0 ws compare ws with 0x0000 1 1 c,dc,n,ov,z 20 cpb cpb f compare f with wreg, with borrow 1 1 c,dc,n,ov,z cpb wb,#lit8 compare wb with lit8, with borrow 1 1 c,dc,n,ov,z cpb wb,ws compare wb with ws, with borrow (wb ? ws ? c ) 1 1 c,dc,n,ov,z 21 cpseq cpseq wb,wn compare wb with wn, skip if = 1 1 (2 or 3) none cpbeq cpbeq wb,wn,expr compare wb with wn, branch if = 1 1 (5) none 22 cpsgt cpsgt wb,wn compare wb with wn, skip if > 1 1 (2 or 3) none cpbgt cpbgt wb,wn,expr compare wb with wn, branch if > 1 1 (5) none 23 cpslt cpslt wb,wn compare wb with wn, skip if < 1 1 (2 or 3) none cpblt cpblt wb,wn,expr compare wb with wn, branch if < 1 1 (5) none 24 cpsne cpsne wb,wn compare wb with wn, skip if ? 11 (2 or 3) none cpbne cpbne wb,wn,expr compare wb with wn, branch if ? 11 (5) none table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: these instructions are available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 390 ? 2011-2013 microchip technology inc. 25 daw daw wn wn = decimal adjust wn 1 1 c 26 dec dec f f = f ? 1 1 1 c,dc,n,ov,z dec f,wreg wreg = f ? 1 1 1 c,dc,n,ov,z dec ws,wd wd = ws ? 1 1 1 c,dc,n,ov,z 27 dec2 dec2 f f = f ? 2 1 1 c,dc,n,ov,z dec2 f,wreg wreg = f ? 2 1 1 c,dc,n,ov,z dec2 ws,wd wd = ws ? 2 1 1 c,dc,n,ov,z 28 disi disi #lit14 disable interrupts for k instruction cycles 1 1 none 29 div div.s wm,wn signed 16/16-bit integer divide 1 18 n,z,c,ov div.sd wm,wn signed 32/16-bit integer divide 1 18 n,z,c,ov div.u wm,wn unsigned 16/16-bit integer divide 1 18 n,z,c,ov div.ud wm,wn unsigned 32/16-bit integer divide 1 18 n,z,c,ov 30 divf divf wm,wn ( 1 ) signed 16/16-bit fractional divide 1 18 n,z,c,ov 31 do do #lit15,expr ( 1 ) do code to pc + expr, lit15 + 1 times 2 2 none do wn,expr ( 1 ) do code to pc + expr, (wn) + 1 times 2 2 none 32 ed ed wm*wm,acc,wx,wy,wxd ( 1 ) euclidean distance (no accumulate) 1 1 oa,ob,oab, sa,sb,sab 33 edac edac wm*wm,acc,wx,wy,wxd ( 1 ) euclidean distance 1 1 oa,ob,oab, sa,sb,sab 34 exch exch wns,wnd swap wns with wnd 1 1 none 35 fbcl fbcl ws,wnd find bit change from left (msb) side 1 1 c 36 ff1l ff1l ws,wnd find first one from left (msb) side 1 1 c 37 ff1r ff1r ws,wnd find first one from right (lsb) side 1 1 c 38 goto goto expr go to address 2 4 none goto wn go to indirect 1 4 none goto.l wn go to indirect (long address) 1 4 none 39 inc inc f f = f + 1 1 1 c,dc,n,ov,z inc f,wreg wreg = f + 1 1 1 c,dc,n,ov,z inc ws,wd wd = ws + 1 1 1 c,dc,n,ov,z 40 inc2 inc2 f f = f + 2 1 1 c,dc,n,ov,z inc2 f,wreg wreg = f + 2 1 1 c,dc,n,ov,z inc2 ws,wd wd = ws + 2 1 1 c,dc,n,ov,z 41 ior ior f f = f .ior. wreg 1 1 n,z ior f,wreg wreg = f .ior. wreg 1 1 n,z ior #lit10,wn wd = lit10 .ior. wd 1 1 n,z ior wb,ws,wd wd = wb .ior. ws 1 1 n,z ior wb,#lit5,wd wd = wb .ior. lit5 1 1 n,z 42 lac lac wso,#slit4,acc load accumulator 1 1 oa,ob,oab, sa,sb,sab 43 lnk lnk #lit14 link frame pointer 1 1 sfa 44 lsr lsr f f = logical right shift f 1 1 c,n,ov,z lsr f,wreg wreg = logical right shift f 1 1 c,n,ov,z lsr ws,wd wd = logical right shift ws 1 1 c,n,ov,z lsr wb,wns,wnd wnd = logical right shift wb by wns 1 1 n,z lsr wb,#lit5,wnd wnd = logical right shift wb by lit5 1 1 n,z 45 mac mac wm*wn,acc,wx,wxd,wy,wyd,awb ( 1 ) multiply and accumulate 1 1 oa,ob,oab, sa,sb,sab mac wm*wm,acc,wx,wxd,wy,wyd ( 1 ) square and accumulate 1 1 oa,ob,oab, sa,sb,sab table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: these instructions are available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 391 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 46 mov mov f,wn move f to wn 1 1 none mov f move f to f 1 1 none mov f,wreg move f to wreg 1 1 none mov #lit16,wn move 16-bit literal to wn 1 1 none mov.b #lit8,wn move 8-bit literal to wn 1 1 none mov wn,f move wn to f 1 1 none mov wso,wdo move ws to wd 1 1 none mov wreg,f move wreg to f 1 1 none mov.d wns,wd move double from w(ns):w(ns + 1) to wd 1 2 none mov.d ws,wnd move double from ws to w(nd + 1):w(nd) 1 2 none 47 movpag movpag #lit10,dsrpag move 10-bit literal to dsrpag 1 1 none movpag #lit9,dswpag move 9-bit literal to dswpag 1 1 none movpag #lit8,tblpag move 8-bit literal to tblpag 1 1 none movpag ws, dsrpag move ws<9:0> to dsrpag 1 1 none movpag ws, dswpag move ws<8:0> to dswpag 1 1 none movpag ws, tblpag move ws<7:0> to tblpag 1 1 none 48 movsac movsac acc,wx,wxd,wy,wyd,awb ( 1 ) prefetch and store accumulator 1 1 none 49 mpy mpy wm*wn,acc,wx,wxd,wy,wyd ( 1 ) multiply wm by wn to accumulator 1 1 oa,ob,oab, sa,sb,sab mpy wm*wm,acc,wx,wxd,wy,wyd ( 1 ) square wm to accumulator 1 1 oa,ob,oab, sa,sb,sab 50 mpy.n mpy.n wm*wn,acc,wx,wxd,wy,wyd ( 1 ) -(multiply wm by wn) to accumulator 1 1 none 51 msc msc wm*wm,acc,wx,wxd,wy,wyd,awb ( 1 ) multiply and subtract from accumulator 1 1 oa,ob,oab, sa,sb,sab 52 mul mul.ss wb,ws,wnd {wnd + 1, wnd} = signed(wb) * signed(ws) 11 none mul.ss wb,ws,acc ( 1 ) accumulator = signed(wb) * signed(ws) 1 1 none mul.su wb,ws,wnd {wnd + 1, wnd} = signed(wb) * unsigned(ws) 11 none mul.su wb,ws,acc ( 1 ) accumulator = signed(wb) * unsigned(ws) 11 none mul.su wb,#lit5,acc ( 1 ) accumulator = signed(wb) * unsigned(lit5) 1 1 none mul.us wb,ws,wnd {wnd + 1, wnd} = unsigned(wb) * signed(ws) 11 none mul.us wb,ws,acc ( 1 ) accumulator = unsigned(wb) * signed(ws) 11 none mul.uu wb,ws,wnd {wnd + 1, wnd} = unsigned(wb) * unsigned(ws) 11 none mul.uu wb,#lit5,acc ( 1 ) accumulator = unsigned(wb) * unsigned(lit5) 11 none mul.uu wb,ws,acc ( 1 ) accumulator = unsigned(wb) * unsigned(ws) 11 none mulw.ss wb,ws,wnd wnd = signed(wb) * signed(ws) 1 1 none mulw.su wb,ws,wnd wnd = signed(wb) * unsigned(ws) 1 1 none mulw.us wb,ws,wnd wnd = unsigned(wb) * signed(ws) 1 1 none mulw.uu wb,ws,wnd wnd = unsigned(wb) * unsigned(ws) 1 1 none mul.su wb,#lit5,wnd {wnd + 1, wnd} = signed(wb) * unsigned(lit5) 11 none mul.su wb,#lit5,wnd wnd = signed(wb) * unsigned(lit5) 1 1 none mul.uu wb,#lit5,wnd {wnd + 1, wnd} = unsigned(wb) * unsigned(lit5) 11 none mul.uu wb,#lit5,wnd wnd = unsigned(wb) * unsigned(lit5) 1 1 none mul f w3:w2 = f * wreg 1 1 none table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: these instructions are available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 392 ? 2011-2013 microchip technology inc. 53 neg neg acc ( 1 ) negate accumulator 1 1 oa,ob,oab, sa,sb,sab neg f f = f + 1 1 1 c,dc,n,ov,z neg f,wreg wreg = f + 1 1 1 c,dc,n,ov,z neg ws,wd wd = ws + 1 1 1 c,dc,n,ov,z 54 nop nop no operation 1 1 none nopr no operation 1 1 none 55 pop pop f pop f from top-of-stack (tos) 1 1 none pop wdo pop from top-of-stack (tos) to wdo 1 1 none pop.d wnd pop from top-of-stack (tos) to w(nd):w(nd + 1) 12 none pop.s pop shadow registers 1 1 all 56 push push f push f to top-of-stack (tos) 1 1 none push wso push wso to top-of-stack (tos) 1 1 none push.d wns push w(ns):w(ns + 1) to top-of-stack (tos) 12 none push.s push shadow registers 1 1 none 57 pwrsav pwrsav #lit1 go into sleep or idle mode 1 1 wdto,sleep 58 rcall rcall expr relative call 1 4 sfa rcall wn computed call 1 4 sfa 59 repeat repeat #lit15 repeat next instruction lit15 + 1 times 1 1 none repeat wn repeat next instruction (wn) + 1 times 1 1 none 60 reset reset software device reset 1 1 none 61 retfie retfie return from interrupt 1 6 (5) sfa 62 retlw retlw #lit10,wn return with literal in wn 1 6 (5) sfa 63 return return return from subroutine 1 6 (5) sfa 64 rlc rlc f f = rotate left through carry f 1 1 c,n,z rlc f,wreg wreg = rotate left through carry f 1 1 c,n,z rlc ws,wd wd = rotate left through carry ws 1 1 c,n,z 65 rlnc rlnc f f = rotate left (no carry) f 1 1 n,z rlnc f,wreg wreg = rotate left (no carry) f 1 1 n,z rlnc ws,wd wd = rotate left (no carry) ws 1 1 n,z 66 rrc rrc f f = rotate right through carry f 1 1 c,n,z rrc f,wreg wreg = rotate right through carry f 1 1 c,n,z rrc ws,wd wd = rotate right through carry ws 1 1 c,n,z 67 rrnc rrnc f f = rotate right (no carry) f 1 1 n,z rrnc f,wreg wreg = rotate right (no carry) f 1 1 n,z rrnc ws,wd wd = rotate right (no carry) ws 1 1 n,z 68 sac sac acc,#slit4,wdo ( 1 ) store accumulator 1 1 none sac.r acc,#slit4,wdo ( 1 ) store rounded accumulator 1 1 none 69 se se ws,wnd wnd = sign-extended ws 1 1 c,n,z 70 setm setm f f = 0xffff 1 1 none setm wreg wreg = 0xffff 1 1 none setm ws ws = 0xffff 1 1 none 71 sftac sftac acc,wn ( 1 ) arithmetic shift accumulator by (wn) 1 1 oa,ob,oab, sa,sb,sab sftac acc,#slit6 ( 1 ) arithmetic shift accumulator by slit6 1 1 oa,ob,oab, sa,sb,sab table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: these instructions are available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
? 2011-2013 microchip technology inc. ds70657g-page 393 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 72 sl sl f f = left shift f 1 1 c,n,ov,z sl f,wreg wreg = left shift f 1 1 c,n,ov,z sl ws,wd wd = left shift ws 1 1 c,n,ov,z sl wb,wns,wnd wnd = left shift wb by wns 1 1 n,z sl wb,#lit5,wnd wnd = left shift wb by lit5 1 1 n,z 73 sub sub acc ( 1 ) subtract accumulators 1 1 oa,ob,oab, sa,sb,sab sub f f = f ? wreg 1 1 c,dc,n,ov,z sub f,wreg wreg = f ? wreg 1 1 c,dc,n,ov,z sub #lit10,wn wn = wn ? lit10 1 1 c,dc,n,ov,z sub wb,ws,wd wd = wb ? ws 1 1 c,dc,n,ov,z sub wb,#lit5,wd wd = wb ? lit5 1 1 c,dc,n,ov,z 74 subb subb f f = f ? wreg ? (c ) 1 1 c,dc,n,ov,z subb f,wreg wreg = f ? wreg ? (c ) 1 1 c,dc,n,ov,z subb #lit10,wn wn = wn ? lit10 ? (c ) 1 1 c,dc,n,ov,z subb wb,ws,wd wd = wb ? ws ? (c ) 1 1 c,dc,n,ov,z subb wb,#lit5,wd wd = wb ? lit5 ? (c ) 1 1 c,dc,n,ov,z 75 subr subr f f = wreg ? f 1 1 c,dc,n,ov,z subr f,wreg wreg = wreg ? f 1 1 c,dc,n,ov,z subr wb,ws,wd wd = ws ? wb 1 1 c,dc,n,ov,z subr wb,#lit5,wd wd = lit5 ? wb 1 1 c,dc,n,ov,z 76 subbr subbr f f = wreg ? f ? (c ) 1 1 c,dc,n,ov,z subbr f,wreg wreg = wreg ? f ? (c ) 1 1 c,dc,n,ov,z subbr wb,ws,wd wd = ws ? wb ? (c ) 1 1 c,dc,n,ov,z subbr wb,#lit5,wd wd = lit5 ? wb ? (c ) 1 1 c,dc,n,ov,z 77 swap swap.b wn wn = nibble swap wn 1 1 none swap wn wn = byte swap wn 1 1 none 78 tblrdh tblrdh ws,wd read prog<23:16> to wd<7:0> 1 5 none 79 tblrdl tblrdl ws,wd read prog<15:0> to wd 1 5 none 80 tblwth tblwth ws,wd write ws<7:0> to prog<23:16> 1 2 none 81 tblwtl tblwtl ws,wd write ws to prog<15:0> 1 2 none 82 ulnk ulnk unlink frame pointer 1 1 sfa 83 xor xor f f = f .xor. wreg 1 1 n,z xor f,wreg wreg = f .xor. wreg 1 1 n,z xor #lit10,wn wd = lit10 .xor. wd 1 1 n,z xor wb,ws,wd wd = wb .xor. ws 1 1 n,z xor wb,#lit5,wd wd = wb .xor. lit5 1 1 n,z 84 ze ze ws,wnd wnd = zero-extend ws 1 1 c,z,n table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: these instructions are available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 394 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 395 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 29.0 development support the pic ? microcontrollers and dspic ? digital signal controllers are supported with a full range of software and hardware development tools: ? integrated development environment - mplab ? ide software ? compilers/assemblers/linkers - mplab c compiler for various device families - hi-tech c ? for various device families - mpasm tm assembler -mplink tm object linker/ mplib tm object librarian - mplab assembler/linker/librarian for various device families ? simulators - mplab sim software simulator ?emulators - mplab real ice? in-circuit emulator ? in-circuit debuggers - mplab icd 3 - pickit? 3 debug express ? device programmers - pickit? 2 programmer - mplab pm3 device programmer ? low-cost demonstration/development boards, evaluation kits, and starter kits 29.1 mplab integrated development environment software the mplab ide software brings an ease of software development previously unseen in the 8/16/32-bit microcontroller market. the mplab ide is a windows ? operating system-based application that contains: ? a single graphical interface to all debugging tools - simulator - programmer (sold separately) - in-circuit emulator (sold separately) - in-circuit debugger (sold separately) ? a full-featured editor with color-coded context ? a multiple project manager ? customizable data windows with direct edit of contents ? high-level source code debugging ? mouse over variable inspection ? drag and drop variables from source to watch windows ? extensive on-line help ? integration of select third party tools, such as iar c compilers the mplab ide allows you to: ? edit your source files (either c or assembly) ? one-touch compile or assemble, and download to emulator and simulator tools (automatically updates all project information) ? debug using: - source files (c or assembly) - mixed c and assembly - machine code mplab ide supports multiple debugging tools in a single development paradigm, from the cost-effective simulators, through low-cost in-circuit debuggers, to full-featured emulators. this eliminates the learning curve when upgrading to tools with increased flexibility and power.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 396 ? 2011-2013 microchip technology inc. 29.2 mplab c compilers for various device families the mplab c compiler code development systems are complete ansi c compilers for microchip?s pic18, pic24 and pic32 families of microcontrollers and the dspic30 and dspic33 families of digital signal control- lers. these compilers provide powerful integration capabilities, superior code optimization and ease of use. for easy source level debugging, the compilers provide symbol information that is optimized to the mplab ide debugger. 29.3 hi-tech c for various device families the hi-tech c compiler code development systems are complete ansi c compilers for microchip?s pic family of microcontrollers and the dspic family of digital signal controllers. these compilers provide powerful integration capabilities, omniscient code generation and ease of use. for easy source level debugging, the compilers provide symbol information that is optimized to the mplab ide debugger. the compilers include a macro assembler, linker, pre- processor, and one-step driver, and can run on multiple platforms. 29.4 mpasm assembler the mpasm assembler is a full-featured, universal macro assembler for pic10/12/16/18 mcus. the mpasm assembler generates relocatable object files for the mplink object linker, intel ? standard hex files, map files to detail memory usage and symbol reference, absolute lst files that contain source lines and generated machine code and coff files for debugging. the mpasm assembler features include: ? integration into mplab ide projects ? user-defined macros to streamline assembly code ? conditional assembly for multi-purpose source files ? directives that allow complete control over the assembly process 29.5 mplink object linker/ mplib object librarian the mplink object linker combines relocatable objects created by the mpasm assembler and the mplab c18 c compiler. it can link relocatable objects from precompiled libraries, using directives from a linker script. the mplib object librarian manages the creation and modification of library files of precompiled code. when a routine from a library is called from a source file, only the modules that contain that routine will be linked in with the application. this allows large libraries to be used efficiently in many different applications. the object linker/library features include: ? efficient linking of single libraries instead of many smaller files ? enhanced code maintainability by grouping related modules together ? flexible creation of libraries with easy module listing, replacement, deletion and extraction 29.6 mplab assembler, linker and librarian for various device families mplab assembler produces relocatable machine code from symbolic assembly language for pic24, pic32 and dspic devices. mplab c compiler uses the assembler to produce its object file. the assembler generates relocatable object files that can then be archived or linked with other relocatable object files and archives to create an executable file. notable features of the assembler include: ? support for the entire device instruction set ? support for fixed-point and floating-point data ? command line interface ? rich directive set ? flexible macro language ? mplab ide compatibility
? 2011-2013 microchip technology inc. ds70657g-page 397 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 29.7 mplab sim software simulator the mplab sim software simulator allows code development in a pc-hosted environment by simulat- ing the pic mcus and dspic ? dscs on an instruction level. on any given instruction, the data areas can be examined or modified and stimuli can be applied from a comprehensive stimulus controller. registers can be logged to files for further run-time analysis. the trace buffer and logic analyzer display extend the power of the simulator to record and track program execution, actions on i/o, most peripherals and internal registers. the mplab sim software simulator fully supports symbolic debugging using the mplab c compilers, and the mpasm and mplab assemblers. the soft- ware simulator offers the flexibility to develop and debug code outside of the hardware laboratory envi- ronment, making it an excellent, economical software development tool. 29.8 mplab real ice in-circuit emulator system mplab real ice in-circuit emulator system is microchip?s next generation high-speed emulator for microchip flash dsc and mcu devices. it debugs and programs pic ? flash mcus and dspic ? flash dscs with the easy-to-use, powerful graphical user interface of the mplab integrated development environment (ide), included with each kit. the emulator is connected to the design engineer?s pc using a high-speed usb 2.0 interface and is connected to the target with either a connector compatible with in- circuit debugger systems (rj11) or with the new high- speed, noise tolerant, low-voltage differential signal (lvds) interconnection (cat5). the emulator is field upgradable through future firmware downloads in mplab ide. in upcoming releases of mplab ide, new devices will be supported, and new features will be added. mplab real ice offers significant advantages over competitive emulators including low-cost, full-speed emulation, run-time variable watches, trace analysis, complex breakpoints, a ruggedized probe interface and long (up to three meters) interconnection cables. 29.9 mplab icd 3 in-circuit debugger system mplab icd 3 in-circuit debugger system is micro- chip?s most cost effective high-speed hardware debugger/programmer for microchip flash digital sig- nal controller (dsc) and microcontroller (mcu) devices. it debugs and programs pic ? flash microcon- trollers and dspic ? dscs with the powerful, yet easy- to-use graphical user interface of mplab integrated development environment (ide). the mplab icd 3 in-circuit debugger probe is con- nected to the design engineer?s pc using a high-speed usb 2.0 interface and is connected to the target with a connector compatible with the mplab icd 2 or mplab real ice systems (rj-11). mplab icd 3 supports all mplab icd 2 headers. 29.10 pickit 3 in-circuit debugger/ programmer and pickit 3 debug express the mplab pickit 3 allows debugging and program- ming of pic ? and dspic ? flash microcontrollers at a most affordable price point using the powerful graphical user interface of the mplab integrated development environment (ide). the mplab pickit 3 is connected to the design engineer?s pc using a full speed usb interface and can be connected to the target via an microchip debug (rj-11) connector (compatible with mplab icd 3 and mplab real ice). the connector uses two device i/o pins and the reset line to imple- ment in-circuit debugging and in-circuit serial pro- gramming?. the pickit 3 debug express include the pickit 3, demo board and microcontroller, hookup cables and cdrom with user?s guide, lessons, tutorial, compiler and mplab ide software.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 398 ? 2011-2013 microchip technology inc. 29.11 pickit 2 development programmer/debugger and pickit 2 debug express the pickit? 2 development programmer/debugger is a low-cost development tool with an easy to use inter- face for programming and debugging microchip?s flash families of microcontrollers. the full featured windows ? programming interface supports baseline (pic10f, pic12f5xx, pic16f5xx), midrange (pic12f6xx, pic16f), pic18f, pic24, dspic30, dspic33, and pic32 families of 8-bit, 16-bit, and 32-bit microcontrollers, and many microchip serial eeprom products. with microchip?s powerful mplab integrated development environment (ide) the pickit? 2 enables in-circuit debugging on most pic ? microcon- trollers. in-circuit-debugging runs, halts and single steps the program while the pic microcontroller is embedded in the application. when halted at a break- point, the file registers can be examined and modified. the pickit 2 debug express include the pickit 2, demo board and microcontroller, hookup cables and cdrom with user?s guide, lessons, tutorial, compiler and mplab ide software. 29.12 mplab pm3 device programmer the mplab pm3 device programmer is a universal, ce compliant device programmer with programmable voltage verification at v ddmin and v ddmax for maximum reliability. it features a large lcd display (128 x 64) for menus and error messages and a modu- lar, detachable socket assembly to support various package types. the icsp? cable assembly is included as a standard item. in stand-alone mode, the mplab pm3 device programmer can read, verify and program pic devices without a pc connection. it can also set code protection in this mode. the mplab pm3 connects to the host pc via an rs-232 or usb cable. the mplab pm3 has high-speed communications and optimized algorithms for quick programming of large memory devices and incorporates an mmc card for file storage and data applications. 29.13 demonstration/development boards, evaluation kits, and starter kits a wide variety of demonstration, development and evaluation boards for various pic mcus and dspic dscs allows quick application development on fully func- tional systems. most boards include prototyping areas for adding custom circuitry and provide application firmware and source code for examination and modification. the boards support a variety of features, including leds, temperature sensors, switches, speakers, rs-232 interfaces, lcd displays, potentiometers and additional eeprom memory. the demonstration and development boards can be used in teaching environments, for prototyping custom circuits and for learning about various microcontroller applications. in addition to the picdem? and dspicdem? demon- stration/development board series of circuits, microchip has a line of evaluation kits and demonstration software for analog filter design, k ee l oq ? security ics, can, irda ? , powersmart battery management, seeval ? evaluation system, sigma-delta adc, flow rate sensing, plus many more. also available are starter kits that contain everything needed to experience the specified device. this usually includes a single application and debug capability, all on one board. check the microchip web page ( www.microchip.com ) for the complete list of demonstration, development and evaluation kits.
? 2011-2013 microchip technology inc. ds70657g-page 399 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 30.0 electrical characteristics this section provides an overview of dspi c33epxxxgp50x, dspic33epxxxmc2 0x/50x and pic24epxxxgp/ mc20x electrical characteristics. additional information will be provided in future revisions of this document as it becomes available. absolute maximum ratings for the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x family are listed below. exposure to these maximum rating conditions for extended periods may affect device reliability. functional operation of the device at these or any other conditions above the parameters indicated in the operation listings of this specification is not implied. absolute maximum ratings ( 1 ) ambient temperature under bias................................................................................................. ............-40c to +125c storage temperature ............................................................................................................ .................. -65c to +150c voltage on v dd with respect to v ss ......................................................................................................... -0.3v to +4.0v voltage on any pin that is not 5v tolerant, with respect to v ss ( 3 ) ................................................... -0.3v to (v dd + 0.3v) voltage on any 5v tolerant pin with respect to v ss when v dd ? 3.0v ( 3 ) .................................................. -0.3v to +5.5v voltage on any 5v tolerant pin with respect to vss when v dd < 3.0v ( 3 ) .................................................. -0.3v to +3.6v maximum current out of v ss pin ........................................................................................................................... 300 ma maximum current into v dd pin ( 2 ) ...........................................................................................................................300 ma maximum current sunk/sourced by any 4x i/o pin................................................................................. .................15 ma maximum current sunk/sourced by any 8x i/o pin ................................................................................. .................25 ma maximum current sunk by all ports ( 2 , 4 ) .................................................................................................................200 ma note 1: stresses above those listed under ?absolute maximum ratings? may cause permanent damage to the device. this is a stress rating only, and functional operation of the device at those or any other conditions above those indicated in the operation listings of this specification is not implied. exposure to maximum rating conditions for extended periods may affect device reliability. 2: maximum allowable current is a function of device maximum power dissipation (see tab l e 3 0- 2 ). 3: see the ? pin diagrams ? section for the 5v tolerant pins. 4: exceptions are: dspic33epxxxgp502, dspic33epxxxmc202/502 and pic24epxxxgp/mc202 devices, which have a maximum sink/source capability of 130 ma.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 400 ? 2011-2013 microchip technology inc. 30.1 dc characteristics table 30-1: operating mips vs. voltage characteristic v dd range (in volts) temp range (in c) maximum mips dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ? 3.0v to 3.6v ( 1 ) -40c to +85c 70 ? 3.0v to 3.6v ( 1 ) -40c to +125c 60 note 1: device is functional at v bormin < v dd < v ddmin . analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. device functionality is tested but not characterized. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. table 30-2: thermal operating conditions rating symbol min. typ. max. unit industrial temperature devices operating junction temperature range t j -40 ? +125 c operating ambient temperature range t a -40 ? +85 c extended temperature devices operating junction temperature range t j -40 ? +140 c operating ambient temperature range t a -40 ? +125 c power dissipation: internal chip power dissipation: p int = v dd x (i dd ? ? i oh ) p d p int + p i / o w i/o pin power dissipation: i/o = ? ({v dd ? v oh } x i oh ) + ? (v ol x i ol ) maximum allowed power dissipation p dmax (t j ? t a )/ ? ja w table 30-3: thermal packaging characteristics characteristic symbol typ. max. unit notes package thermal resistance, 64-pin qfn ? ja 28.0 ? c/w 1 package thermal resistance, 64-pin tqfp 10x10 mm ? ja 48.3 ? c/w 1 package thermal resistance, 44-pin qfn ? ja 29.0 ? c/w 1 package thermal resistance, 44-pin tqfp 10x10 mm ? ja 49.8 ? c/w 1 package thermal resistance, 44-pin vtla 6x6 mm ? ja 25.2 ? c/w 1 package thermal resistance, 36-pin vtla 5x5 mm ? ja 28.5 ? c/w 1 package thermal resistance, 28-pin qfn-s ? ja 30.0 ? c/w 1 package thermal resistance, 28-pin ssop ? ja 71.0 ? c/w 1 package thermal resistance, 28-pin soic ? ja 69.7 ? c/w 1 package thermal resistance, 28-pin spdip ? ja 60.0 ? c/w 1 note 1: junction to ambient thermal resistance, theta- ja ( ? ja ) numbers are achieved by package simulations.
? 2011-2013 microchip technology inc. ds70657g-page 401 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-5: filter capacitor (c efc ) specifications table 30-4: dc temperature and voltage specifications dc characteristics standard operating conditions (see note 1 ): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions operating voltage dc10 v dd supply voltage 3.0 ? 3.6 v dc16 v por v dd start voltage to ensure internal power-on reset signal ??v ss v dc17 s vdd v dd rise rate to ensure internal power-on reset signal 0.03 ? ? v/ms 0v-1v in 100 ms note 1: device is functional at v bormin < v dd < v ddmin . analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. device functionality is tested but not characterized. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. standard operating conditions (unless otherwise stated): operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristics min. typ. max. units comments c efc external filter capacitor value ( 1 ) 4.7 10 ? ? f capacitor must have a low series resistance (< 1 ohm) note 1: typical v cap voltage = 1.8 volts when v dd ? v ddmin .
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 402 ? 2011-2013 microchip technology inc. table 30-6: dc characteristics: operating current (i dd ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. units conditions operating current (i dd ) ( 1 ) dc20d 9 15 ma -40c 3.3v 10 mips dc20a 9 15 ma +25c dc20b 9 15 ma +85c dc20c 9 15 ma +125c dc22d 16 25 ma -40c 3.3v 20 mips dc22a 16 25 ma +25c dc22b 16 25 ma +85c dc22c 16 25 ma +125c dc24d 27 35 ma -40c 3.3v 40 mips dc24a 27 35 ma +25c dc24b 27 35 ma +85c dc24c 27 35 ma +125c dc25d 36 55 ma -40c 3.3v 60 mips dc25a 36 55 ma +25c dc25b 36 55 ma +85c dc25c 36 55 ma +125c dc26d 41 60 ma -40c 3.3v 70 mips dc26a 41 60 ma +25c dc26b 41 60 ma +85c note 1: i dd is primarily a function of the operating voltage and frequency. other factors, such as i/o pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current consumption. the test conditions for all i dd measurements are as follows: ? oscillator is configured in ec mode with pll, osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? cpu, sram, program memory and data memory are operational ? no peripheral modules are operating; however, every peripheral is being clocked (all pmdx bits are zeroed) ? cpu is executing while(1) statement ? jtag is disabled
? 2011-2013 microchip technology inc. ds70657g-page 403 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-7: dc characteristics: idle current (i idle ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. units conditions idle current (i idle ) ( 1 ) dc40d 3 8 ma -40c 3.3v 10 mips dc40a 3 8 ma +25c dc40b 3 8 ma +85c dc40c 3 8 ma +125c dc42d 6 12 ma -40c 3.3v 20 mips dc42a 6 12 ma +25c dc42b 6 12 ma +85c dc42c 6 12 ma +125c dc44d 11 18 ma -40c 3.3v 40 mips dc44a 11 18 ma +25c 18 dc44b 11 ma +85c 18 dc44c 11 ma +125c dc45d 17 27 ma -40c 3.3v 60 mips dc45a 17 27 ma +25c 27 dc45b 17 ma +85c 27 dc45c 17 ma +125c dc46d 20 35 ma -40c 3.3v 70 mips dc46a 20 35 ma +25c 35 dc46b 20 ma +85c note 1: base idle current (i idle ) is measured as follows: ? cpu core is off, oscillator is configured in ec mode and external clock is active; osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? no peripheral modules are operating; however, every peripheral is being clocked (all pmdx bits are zeroed) ? the nvmsidl bit (nvmcon<12>) = 1 (i.e., flash regulator is set to standby while the device is in idle mode) ? the vregsf bit (rcon<11>) = 0 (i.e., flash regulator is set to standby while the device is in sleep mode) ? jtag is disabled
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 404 ? 2011-2013 microchip technology inc. table 30-8: dc characteristics: power-down current (i pd ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. units conditions power-down current (i pd ) ( 1 ) ? dspic33ep32gp50x, dspic33ep32mc20x/50x and pic24ep32gp/mc20x dc60d 30 100 ? a -40c 3.3v dc60a 35 100 ? a+25c dc60b 150 200 ? a+85c dc60c 250 500 ? a +125c power-down current (i pd ) ( 1 ) ? dspic33ep64gp50x, dspic33ep64mc20x/50x and pic24ep64gp/mc20x dc60d 25 100 ? a -40c 3.3v dc60a 30 100 ? a+25c dc60b 150 350 ? a+85c dc60c 350 800 ? a +125c power-down current (i pd ) ( 1 ) ? dspic33ep128gp50x, dspic33ep128mc20x/50x and pic24ep128gp/mc20x dc60d 30 100 ? a -40c 3.3v dc60a 35 100 ? a+25c dc60b 150 350 ? a+85c dc60c 550 1000 ? a +125c power-down current (i pd ) ( 1 ) ? dspic33ep256gp50x, dspic33ep256mc20x/50x and pic24ep256gp/mc20x dc60d 35 100 ? a -40c 3.3v dc60a 40 100 ? a+25c dc60b 250 450 ? a+85c dc60c 1000 1200 ? a +125c power-down current (i pd ) ( 1 ) ? dspic33ep512gp50x, dspic33ep512mc20x/50x and pic24ep512gp/mc20x dc60d 40 ? ? a -40c 3.3v dc60a 45 ? ? a+25c dc60b 350 ? ? a+85c dc60c 1500 ? ? a +125c note 1: i pd (sleep) current is measured as follows: ? cpu core is off, oscillator is configured in ec mode and external clock is active; osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? all peripheral modules are disabled (pmdx bits are all set) ? the vregs bit (rcon<8>) = 0 (i.e., core regulator is set to standby while the device is in sleep mode) ? the vregsf bit (rcon<11>) = 0 (i.e., flash regulator is set to standby while the device is in sleep mode) ? jtag is disabled
? 2011-2013 microchip technology inc. ds70657g-page 405 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-9: dc characteristics: watchdog timer delta current ( ? i wdt ) ( 1 ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. units conditions dc61d 8 ? ? a-40c 3.3v dc61a 10 ? ? a +25c dc61b 12 ? ? a +85c dc61c 13 ? ? a +125c note 1: the ? i wdt current is the additional current consumed when the module is enabled. this current should be added to the base i pd current. all parameters are characterized but not tested during manufacturing. table 30-10: dc characteristics: doze current (i doze ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. doze ratio units conditions doze current (i doze ) ( 1 ) dc73a ( 2 ) 35 ? 1:2 ma -40c 3.3v f osc = 140 mhz dc73g 20 30 1:128 ma dc70a ( 2 ) 35 ? 1:2 ma +25c 3.3v f osc = 140 mhz dc70g 20 30 1:128 ma dc71a ( 2 ) 35 ? 1:2 ma +85c 3.3v f osc = 140 mhz dc71g 20 30 1:128 ma dc72a ( 2 ) 28 ? 1:2 ma +125c 3.3v f osc = 120 mhz dc72g 15 30 1:128 ma note 1: i doze is primarily a function of the operating voltage and frequency. other factors, such as i/o pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current consumption. the test conditions for all i doze measurements are as follows: ? oscillator is configured in ec mode and external clock is active, osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? cpu, sram, program memory and data memory are operational ? no peripheral modules are operating; however, every peripheral is being clocked (all pmdx bits are zeroed) ? cpu is executing while(1) statement ? jtag is disabled 2: parameter is characterized but not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 406 ? 2011-2013 microchip technology inc. table 30-11: dc characteristics: i/o pin input specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions v il input low voltage di10 any i/o pin and mclr v ss ?0.2v dd v di18 i/o pins with sdax, sclx v ss ?0.3 v dd v smbus disabled di19 i/o pins with sdax, sclx v ss ? 0.8 v smbus enabled v ih input high voltage di20 i/o pins not 5v tolerant 0.8 v dd ?v dd v (note 3 ) i/o pins 5v tolerant and mclr 0.8 v dd ?5.5v (note 3 ) i/o pins with sdax, sclx 0.8 v dd ? 5.5 v smbus disabled i/o pins with sdax, sclx 2.1 ? 5.5 v smbus enabled i cnpu change notification pull-up current di30 150 250 550 ? av dd = 3.3v, v pin = v ss i cnpd change notification pull-down current ( 4 ) di31 20 50 100 ? av dd = 3.3v, v pin = v dd note 1: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 2: negative current is defined as current sourced by the pin. 3: see the ? pin diagrams ? section for the 5v tolerant i/o pins. 4: v il source < (v ss ? 0.3). characterized but not tested. 5: non-5v tolerant pins v ih source > (v dd + 0.3), 5v tolerant pins v ih source > 5.5v. characterized but not tested. 6: digital 5v tolerant pins cannot tolerate any ?positive? input injection current from input sources > 5.5v. 7: injection currents > | 0 | can affect the adc results by approximately 4-6 counts. 8: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted provided the mathematical ?absolute instantaneous? sum of the input injection currents from all pins do not exceed the specified limit. characterized but not tested.
? 2011-2013 microchip technology inc. ds70657g-page 407 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x i il input leakage current ( 1 , 2 ) di50 i/o pins 5v tolerant ( 3 ) -1 ? +1 ? av ss ? v pin ? v dd , pin at high-impedance di51 i/o pins not 5v tolerant ( 3 ) -1 ? +1 ? av ss ? v pin ? v dd , pin at high-impedance, -40c ? t a ? +85c di51a i/o pins not 5v tolerant ( 3 ) -1 ? +1 ? a analog pins shared with external reference pins, -40c ? t a ? +85c di51b i/o pins not 5v tolerant ( 3 ) -1 ? +1 ? av ss ? v pin ? v dd , pin at high-impedance, -40c ? t a ? +125c di51c i/o pins not 5v tolerant ( 3 ) -1 ? +1 ? a analog pins shared with external reference pins, -40c ? t a ? +125c di55 mclr -5 ? +5 ? av ss ?? v pin ?? v dd di56 osc1 -5 ? +5 ? av ss ?? v pin ?? v dd , xt and hs modes table 30-11: dc characteristics: i/o pi n input specifications (continued) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions note 1: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 2: negative current is defined as current sourced by the pin. 3: see the ? pin diagrams ? section for the 5v tolerant i/o pins. 4: v il source < (v ss ? 0.3). characterized but not tested. 5: non-5v tolerant pins v ih source > (v dd + 0.3), 5v tolerant pins v ih source > 5.5v. characterized but not tested. 6: digital 5v tolerant pins cannot tolerate any ?positive? input injection current from input sources > 5.5v. 7: injection currents > | 0 | can affect the adc results by approximately 4-6 counts. 8: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted provided the mathematical ?absolute instantaneous? sum of the input injection currents from all pins do not exceed the specified limit. characterized but not tested.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 408 ? 2011-2013 microchip technology inc. i icl input low injection current di60a 0 ? -5 ( 4 , 7 ) ma all pins except v dd , v ss , av dd , av ss , mclr , v cap and rb7 i ich input high injection current di60b 0 ? +5 ( 5 , 6 , 7 ) ma all pins except v dd , v ss , av dd , av ss , mclr , v cap , rb7 and all 5v tolerant pins ( 6 ) ? i ict total input injection current di60c (sum of all i/o and control pins) -20 ( 8 ) ?+20 ( 8 ) ma absolute instantaneous sum of all input injection cur- rents from all i/o pins (| i icl + | i ich |) ? ? i ict table 30-11: dc characteristics: i/o pi n input specifications (continued) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions note 1: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 2: negative current is defined as current sourced by the pin. 3: see the ? pin diagrams ? section for the 5v tolerant i/o pins. 4: v il source < (v ss ? 0.3). characterized but not tested. 5: non-5v tolerant pins v ih source > (v dd + 0.3), 5v tolerant pins v ih source > 5.5v. characterized but not tested. 6: digital 5v tolerant pins cannot tolerate any ?positive? input injection current from input sources > 5.5v. 7: injection currents > | 0 | can affect the adc results by approximately 4-6 counts. 8: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted provided the mathematical ?absolute instantaneous? sum of the input injection currents from all pins do not exceed the specified limit. characterized but not tested.
? 2011-2013 microchip technology inc. ds70657g-page 409 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-12: dc characteristics: i/o pin output specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic min. typ. max. units conditions do10 v ol output low voltage 4x sink driver pins ( 2 ) ??0.4vv dd = 3.3v, i ol ? 6 ma, -40c ? t a ? +85c i ol ? 5 ma, +85c ? t a ? +125c output low voltage 8x sink driver pins ( 3 ) ??0.4vv dd = 3.3v, i ol ? 12 ma, -40c ? t a ? +85c i ol ? 8 ma, +85c ? t a ? +125c do20 v oh output high voltage 4x source driver pins ( 2 ) 2.4 ? ? v i oh ? -10 ma, v dd = 3.3v output high voltage 8x source driver pins ( 3 ) 2.4 ? ? v i oh ? -15 ma, v dd = 3.3v do20a v oh 1 output high voltage 4x source driver pins ( 2 ) 1.5 ( 1 ) ?? vi oh ? -14 ma, v dd = 3.3v 2.0 ( 1 ) ?? i oh ? -12 ma, v dd = 3.3v 3.0 ( 1 ) ?? i oh ? -7 ma, v dd = 3.3v output high voltage 8x source driver pins ( 3 ) 1.5 ( 1 ) ?? vi oh ? -22 ma, v dd = 3.3v 2.0 ( 1 ) ?? i oh ? -18 ma, v dd = 3.3v 3.0 ( 1 ) ?? i oh ? -10 ma, v dd = 3.3v note 1: parameters are characterized but not tested. 2: includes all i/o pins that are not 8x sink driver pins (see below). 3: includes the following pins: for devices with less than 64 pins: ra3, ra4, ra9, rb<7:15> and rc3 for 64-pin devices: ra4, ra9, rb<7:15>, rc3 and rc15 table 30-13: electrical characteristics: bor dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. ( 2 ) typ. max. units conditions bo10 v bor bor event on v dd transition high-to-low 2.65 ? 2.95 v v dd (notes 2 and 3 ) note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. 2: parameters are for design guidance only and are not tested in manufacturing. 3: the v bor specification is relative to v dd .
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 410 ? 2011-2013 microchip technology inc. table 30-14: dc characteristics: program memory dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions program flash memory d130 e p cell endurance 10,000 ? ? e/w -40 ? c to +125 ? c d131 v pr v dd for read 3.0 ? 3.6 v d132b v pew v dd for self-timed write 3.0 ? 3.6 v d134 t retd characteristic retention 20 ? ? year provided no other specifications are violated, -40 ? c to +125 ? c d135 i ddp supply current during programming ( 2 ) ?10 ?ma d136 i peak instantaneous peak current during start-up ??150ma d137a t pe page erase time 17.7 ? 22.9 ms t pe = 146893 frc cycles, t a = +85c (see note 3 ) d137b t pe page erase time 17.5 ? 23.1 ms t pe = 146893 frc cycles, t a = +125c (see note 3 ) d138a t ww word write cycle time 41.7 ? 53.8 s t ww = 346 frc cycles, t a = +85c (see note 3 ) d138b t ww word write cycle time 41.2 ? 54.4 s t ww = 346 frc cycles, t a = +125c (see note 3 ) note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 2: parameter characterized but not tested in manufacturing. 3: other conditions: frc = 7.37 mhz, tun<5:0> = 011111 (for minimum), tun<5:0> = 100000 (for maximum). this parameter depends on the frc accuracy (see table 30-19 ) and the value of the frc oscillator tuning register (see register 9-4 ). for complete details on calculating the minimum and maximum time, see section 5.3 ?programming operations? .
? 2011-2013 microchip technology inc. ds70657g-page 411 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 30.2 ac characteristics and timing parameters this section defines dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/ mc20x ac characteristics and timing parameters. table 30-15: temperature and vo ltage specifications ? ac figure 30-1: load conditions for device timing specifications table 30-16: capacitiv e loading requirements on output pins ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended operating voltage v dd range as described in section 30.1 ?dc characteristics? . param no. symbol characteristic min. typ. max. units conditions do50 c osco osc2 pin ? ? 15 pf in xt and hs modes, when external clock is used to drive osc1 do56 c io all i/o pins and osc2 ? ? 50 pf ec mode do58 c b sclx, sdax ? ? 400 pf in i 2 c? mode v dd /2 c l r l pin pin v ss v ss c l r l =464 ? c l = 50 pf for all pins except osc2 15 pf for osc2 output load condition 1 ? for all pins except osc2 load condition 2 ? for osc2
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 412 ? 2011-2013 microchip technology inc. figure 30-2: external clock timing q1 q2 q3 q4 osc1 clko q1 q2 q3 q4 os20 os25 os30 os30 os40 os41 os31 os31 table 30-17: external clo ck timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symb characteristic min. typ. ( 1 ) max. units conditions os10 f in external clki frequency (external clocks allowed only in ec and ecpll modes) dc ? 60 mhz ec oscillator crystal frequency 3.5 10 ? ? 10 25 mhz mhz xt hs os20 t osc t osc = 1/f osc 8.33 ? dc ns +125oc t osc = 1/f osc 7.14 ? dc ns +85oc os25 t cy instruction cycle time ( 2 ) 16.67 ? dc ns +125oc instruction cycle time ( 2 ) 14.28 ? dc ns +85oc os30 tosl, to s h external clock in (osc1) high or low time 0.45 x t osc ? 0.55 x t osc ns ec os31 tosr, to s f external clock in (osc1) rise or fall time ? ? 20 ns ec os40 tckr clko rise time ( 3 , 4 ) ?5.2?ns os41 tckf clko fall time ( 3 , 4 ) ?5.2?ns os42 g m external oscillator transconductance ( 4 ) ? 12 ? ma/v hs, v dd = 3.3v, t a = +25oc ?6?ma/vxt, v dd = 3.3v, t a = +25oc note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 2: instruction cycle period (t cy ) equals two times the input oscillator time base period. all specified values are based on characterization data for that particular oscillator type under standard operating conditions with the device executing code. exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. all devices are tested to operate at ?minimum? values with an external clock applied to the osc1 pin. when an external clock input is used, the ?maximum? cycle time limit is ?dc? (no clock) for all devices. 3: measurements are taken in ec mode. the clko signal is measured on the osc2 pin. 4: this parameter is characterized, but not tested in manufacturing.
? 2011-2013 microchip technology inc. ds70657g-page 413 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-18: pll clock ti ming specifications ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions os50 f plli pll voltage controlled oscillator (vco) input frequency range 0.8 ? 8.0 mhz ecpll, xtpll modes os51 f sys on-chip vco system frequency 120 ? 340 mhz os52 t lock pll start-up time (lock time) 0.9 1.5 3.1 ms os53 d clk clko stability (jitter) ( 2 ) -3 0.5 3 % note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. parameters are for design guidance only and are not tested. 2: this jitter specification is based on clock cycle-by-clock cycle measurements. to get the effective jitter for individual time bases, or communication clocks used by the application, use the following formula: for example, if f osc = 120 mhz and the spix bit rate = 10 mhz, the effective jitter is as follows: effective jitter d clk f osc time base or communication clock -------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------------- = effective jitter d clk 120 10 -------- - ------------- - d clk 12 ------------- - d clk 3.464 ------------- - === table 30-19: internal frc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. characteristic min. typ. max. units conditions internal frc accuracy @ frc frequency = 7.37 mhz ( 1 ) f20a frc -1.5 0.5 +1.5 % -40c ? t a ?? -10c v dd = 3.0-3.6v -1 0.5 +1 % -10c ? t a ?? +85c v dd = 3.0-3.6v f20b frc -2 1 +2 % +85c ? t a ? +125c v dd = 3.0-3.6v note 1: frequency is calibrated at +25c and 3.3v. tunx bits can be used to compensate for temperature drift. table 30-20: internal lprc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. characteristic min. typ. max. units conditions lprc @ 32.768 khz ( 1 ) f21a lprc -30 ? +30 % -40c ? t a ? -10c v dd = 3.0-3.6v -20 ? +20 % -10c ? t a ? +85c v dd = 3.0-3.6v f21b lprc -30 ? +30 % +85c ? t a ? +125c v dd = 3.0-3.6v note 1: the change of lprc frequency as v dd changes.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 414 ? 2011-2013 microchip technology inc. figure 30-3: i/o timing characteristics figure 30-4: bor and master clear re set timing characteristics note: refer to figure 30-1 for load conditions. i/o pin (input) i/o pin (output) di35 old value new value di40 do31 do32 table 30-21: i/o timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions do31 t io r port output rise time ? 5 10 ns do32 t io f port output fall time ? 5 10 ns di35 t inp intx pin high or low time (input) 20 ? ? ns di40 t rbp cnx high or low time (input) 2 ? ? t cy note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. mclr (sy20) bor (sy30) t mclr t bor reset sequence cpu starts fetching code various delays (depending on configuration)
? 2011-2013 microchip technology inc. ds70657g-page 415 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-22: reset, watchdog timer, oscill ator start-up timer, power-up timer timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sy00 t pu power-up period ? 400 600 ? s sy10 t ost oscillator start-up time ? 1024 t osc ??t osc = osc1 period sy12 t wdt watchdog timer time-out period 0.85 ? 1.15 ms wdtpre = 0 , wdtpost = 0000 , using lprc tolerances indicated in f21 (see table 30-20 ) at +85oc 3.4 ? 4.6 ms wdtpre = 1 , wdtpost = 0000 , using lprc tolerances indicated in f21 (see table 30-20 ) at +85oc sy13 t ioz i/o high-impedance from mclr low or watchdog timer reset 0.68 0.72 1.2 ? s sy20 t mclr mclr pulse width (low) 2 ? ? ? s sy30 t bor bor pulse width (low) 1 ? ? ? s sy35 t fscm fail-safe clock monitor delay ? 500 900 ? s -40c to +85c sy36 t vreg voltage regulator standby-to-active mode transition time ??30 ? s sy37 t oscdfrc frc oscillator start-up delay 46 48 54 ? s sy38 t oscdlprc lprc oscillator start-up delay ??70 ? s note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 416 ? 2011-2013 microchip technology inc. figure 30-5: timer1-timer5 external cl ock timing characteristics note: refer to figure 30-1 for load conditions. tx11 tx15 tx10 tx20 tmrx os60 txck table 30-23: timer1 external clock timing requirements ( 1 ) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 2 ) min. typ. max. units conditions ta10 t tx h t1ck high time synchronous mode greater of: 20 or (t cy + 20)/n ? ? ns must also meet parameter ta15, n = prescaler value (1, 8, 64, 256) asynchronous 35 ? ? ns ta11 t tx lt1ck low time synchronous mode greater of: 20 or (t cy + 20)/n ? ? ns must also meet parameter ta15, n = prescaler value (1, 8, 64, 256) asynchronous 10 ? ? ns ta15 t tx p t1ck input period synchronous mode greater of: 40 or (2 t cy + 40)/n ? ? ns n = prescale value (1, 8, 64, 256) os60 ft1 t1ck oscillator input frequency range (oscillator enabled by setting bit, tcs (t1con<1>)) dc ? 50 khz ta20 t ckextmrl delay from external t1ck clock edge to timer increment 0.75 t cy + 40 ? 1.75 t cy + 40 ns note 1: timer1 is a type a. 2: these parameters are characterized, but are not tested in manufacturing.
? 2011-2013 microchip technology inc. ds70657g-page 417 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-24: timer2 and timer4 (type b time r) external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions tb10 ttxh txck high time synchronous mode greater of: 20 or (t cy + 20)/n ? ? ns must also meet parameter tb15, n = prescale value (1, 8, 64, 256) tb11 ttxl txck low time synchronous mode greater of: 20 or (t cy + 20)/n ? ? ns must also meet parameter tb15, n = prescale value (1, 8, 64, 256) tb15 ttxp txck input period synchronous mode greater of: 40 or (2 t cy + 40)/n ? ? ns n = prescale value (1, 8, 64, 256) tb20 t ckextmrl delay from external txck clock edge to timer increment 0.75 t cy + 40 ? 1.75 t cy + 40 ns note 1: these parameters are characterized, but are not tested in manufacturing. table 30-25: timer3 and timer5 (type c timer) external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions tc10 ttxh txck high time synchronous t cy + 20 ? ? ns must also meet parameter tc15 tc11 ttxl txck low time synchronous t cy + 20 ? ? ns must also meet parameter tc15 tc15 ttxp txck input period synchronous, with prescaler 2 t cy + 40 ? ? ns n = prescale value (1, 8, 64, 256) tc20 t ckextmrl delay from external txck clock edge to timer increment 0.75 t cy + 40 ? 1.75 t cy + 40 ns note 1: these parameters are characterized, but are not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 418 ? 2011-2013 microchip technology inc. figure 30-6: input capture x (icx) timing characteristics icx ic10 ic11 ic15 note: refer to figure 30-1 for load conditions. table 30-26: input capture x module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. no. symbol characteristics ( 1 ) min. max. units conditions ic10 t cc l icx input low time greater of 12.5 + 25 or (0.5 t cy /n) + 25 ? ns must also meet parameter ic15 n = prescale value (1, 4, 16) ic11 t cc h icx input high time greater of 12.5 + 25 or (0.5 t cy /n) + 25 ? ns must also meet parameter ic15 ic15 t cc p icx input period greater of 25 + 50 or (1 t cy /n) + 50 ?ns note 1: these parameters are characterized, but not tested in manufacturing.
? 2011-2013 microchip technology inc. ds70657g-page 419 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 30-7: output compare x module (o cx) timing characteristics figure 30-8: ocx/pwmx module timing characteristics ocx oc11 oc10 (output compare x note: refer to figure 30-1 for load conditions. or pwmx mode) table 30-27: output compare x module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions oc10 tccf ocx output fall time ? ? ? ns see parameter do32 oc11 tccr ocx output rise time ? ? ? ns see parameter do31 note 1: these parameters are characterized but not tested in manufacturing. ocfa ocx oc20 oc15 table 30-28: ocx/pwmx mode timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions oc15 t fd fault input to pwmx i/o change ??t cy + 20 ns oc20 t flt fault input pulse width t cy + 20 ? ? ns note 1: these parameters are characterized but not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 420 ? 2011-2013 microchip technology inc. figure 30-9: high-speed pwmx mo dule fault timing characteristics (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) figure 30-10: high-speed pwmx module timing characteristics (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) table 30-29: high-speed pwmx module timing requirements (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions mp10 t fpwm pwmx output fall time ? ? ? ns see parameter do32 mp11 t rpwm pwmx output rise time ? ? ? ns see parameter do31 mp20 t fd fault input ? to pwmx i/o change ??15ns mp30 t fh fault input pulse width 15 ? ? ns note 1: these parameters are characterized but not tested in manufacturing. fault input pwmx mp30 mp20 (active-low) pwmx mp11 mp10 note: refer to figure 30-1 for load conditions.
? 2011-2013 microchip technology inc. ds70657g-page 421 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 30-11: timerq (qei module) external clock timing characteristics (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) tq11 tq15 tq10 tq20 qeb poscnt table 30-30: qei module external clock timing requirements (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions tq10 ttqh tqck high time synchronous, with prescaler greater of 12.5 + 25 or (0.5 t cy /n) + 25 ? ? ns must also meet parameter tq15 tq11 ttql tqck low time synchronous, with prescaler greater of 12.5 + 25 or (0.5 t cy /n) + 25 ? ? ns must also meet parameter tq15 tq15 ttqp tqcp input period synchronous, with prescaler greater of 25 + 50 or (1 t cy /n) + 50 ??ns tq20 t ckextmrl delay from external tqck clock edge to timer increment ?1t cy ? note 1: these parameters are characterized but not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 422 ? 2011-2013 microchip technology inc. figure 30-12: qea/qeb input characteristics (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) tq30 tq35 tq31 qea (input) tq30 tq35 tq31 qeb (input) tq36 qeb internal tq40 tq41 table 30-31: quadrature deco der timing requirements (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) typ. ( 2 ) max. units conditions tq30 t qu l quadrature input low time 6 t cy ?ns tq31 t qu h quadrature input high time 6 t cy ?ns tq35 t qu in quadrature input period 12 t cy ?ns tq36 t qu p quadrature phase period 3 t cy ?ns tq40 t quf l filter time to recognize low, with digital filter 3 * n * t cy ? ns n = 1, 2, 4, 16, 32, 64, 128 and 256 (note 3 ) tq41 t quf h filter time to recognize high, with digital filter 3 * n * t cy ? ns n = 1, 2, 4, 16, 32, 64, 128 and 256 (note 3 ) note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. parameters are for design guidance only and are not tested. 3: n = index channel digital filter clock divide select bits. refer to section 15. ?quadrature encoder interface (qei)? (ds70601) in the ? dspic33e/pic24e family reference manual ?. please see the microchip web site for the latest family reference manual sections.
? 2011-2013 microchip technology inc. ds70657g-page 423 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 30-13: qei module inde x pulse timing characteristics (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) qea (input) ungated index qeb (input) tq55 index internal position counter reset tq50 tq51 table 30-32: qei index pulse timing requirements (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. max. units conditions tq50 tqil filter time to recognize low, with digital filter 3 * n * t cy ? ns n = 1, 2, 4, 16, 32, 64, 128 and 256 (note 2 ) tq51 tqih filter time to recognize high, with digital filter 3 * n * t cy ? ns n = 1, 2, 4, 16, 32, 64, 128 and 256 (note 2 ) tq55 tqidxr index pulse recognized to position counter reset (ungated index) 3 t cy ?ns note 1: these parameters are characterized but not tested in manufacturing. 2: alignment of index pulses to qea and qeb is shown for position counter reset timing only. shown for forward direction only (qea leads qeb). same timing applies for reverse direction (qea lags qeb) but index pulse recognition occurs on the falling edge.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 424 ? 2011-2013 microchip technology inc. table 30-33: spi2 maximu m data/clock rate summary figure 30-14: spi2 master mode (half-duplex, transmit only, cke = 0 ) timing characteristics ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended maximum data rate master transmit only (half-duplex) master transmit/receive (full-duplex) slave transmit/receive (full-duplex) cke ckp smp 15 mhz table 30-33 ?? 0 , 10 , 10 , 1 9 mhz ? table 30-34 ? 10 , 11 9 mhz ? table 30-35 ? 00 , 11 15 mhz ? ? table 30-36 100 11 mhz ? ? table 30-37 110 15 mhz ? ? table 30-38 010 11 mhz ? ? table 30-39 000 sck2 (ckp = 0 ) sck2 (ckp = 1 ) sdo2 sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 30-1 for load conditions.
? 2011-2013 microchip technology inc. ds70657g-page 425 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 30-15: spi2 master mode ( half-duplex, transmit only, cke = 1 ) timing characteristics table 30-34: spi2 master mode (half-duple x, transmit only) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck2 frequency ? ? 15 mhz (note 3 ) sp20 tscf sck2 output fall time ? ? ? ns see parameter do32 (note 4 ) sp21 tscr sck2 output rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo2 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo2 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo2 data output valid after sck2 edge ?620ns sp36 tdiv2sch, tdiv2scl sdo2 data output setup to first sck2 edge 30 ? ? ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck2 is 66.7 ns. therefore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi2 pins. sck2 (ckp = 0 ) sck2 (ckp = 1 ) sdo2 sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 426 ? 2011-2013 microchip technology inc. figure 30-16: spi2 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing characteristics table 30-35: spi2 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck2 frequency ? ? 9 mhz (note 3 ) sp20 tscf sck2 output fall time ? ? ? ns see parameter do32 (note 4 ) sp21 tscr sck2 output rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo2 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo2 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo2 data output valid after sck2 edge ?620ns sp36 tdov2sc, tdov2scl sdo2 data output setup to first sck2 edge 30 ??ns sp40 tdiv2sch, tdiv2scl setup time of sdi2 data input to sck2 edge 30 ??ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi2 data input to sck2 edge 30 ??ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck2 is 111 ns. the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi2 pins. sck2 (ckp = 0 ) sck2 (ckp = 1 ) sdo2 sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36 sp41 msb in lsb in bit 14 - - - -1 sdi2 sp40
? 2011-2013 microchip technology inc. ds70657g-page 427 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 30-17: spi2 master mode (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing characteristics table 30-36: spi2 master mode (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck2 frequency ? ? 9 mhz -40oc to +125oc (note 3 ) sp20 tscf sck2 output fall time ? ? ? ns see parameter do32 (note 4 ) sp21 tscr sck2 output rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo2 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo2 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo2 data output valid after sck2 edge ?620ns sp36 tdov2sch, tdov2scl sdo2 data output setup to first sck2 edge 30 ??ns sp40 tdiv2sch, tdiv2scl setup time of sdi2 data input to sck2 edge 30 ??ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi2 data input to sck2 edge 30 ??ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck2 is 111 ns. the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi2 pins. sck2 (ckp = 0 ) sck2 (ckp = 1 ) sdo2 sdi2 sp10 sp40 sp41 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 msb in lsb in bit 14 - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 428 ? 2011-2013 microchip technology inc. figure 30-18: spi2 slave mo de (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing characteristics ss2 sck2 (ckp = 0 ) sck2 (ckp = 1 ) sdo2 sp50 sp60 sdi2 sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 30-1 for load conditions. sp36
? 2011-2013 microchip technology inc. ds70657g-page 429 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-37: spi2 slave mo de (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck2 input frequency ? ? lesser of f p or 15 mhz (note 3 ) sp72 tscf sck2 input fall time ? ? ? ns see parameter do32 (note 4 ) sp73 tscr sck2 input rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo2 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo2 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo2 data output valid after sck2 edge ? 6 20 ns sp36 tdov2sch, tdov2scl sdo2 data output setup to first sck2 edge 30 ? ? ns sp40 tdiv2sch, tdiv2scl setup time of sdi2 data input to sck2 edge 30 ? ? ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi2 data input to sck2 edge 30 ? ? ns sp50 tssl2sch, tssl2scl ss2 ? to sck2 ? or sck2 ?? input 120 ? ? ns sp51 tssh2doz ss2 ? to sdo2 output high-impedance 10 ? 50 ns (note 4 ) sp52 tsch2ssh tscl2ssh ss2 ?? after sck2 edge 1.5 t cy + 40 ? ? ns (note 4 ) sp60 tssl2dov sdo2 data output valid after ss2 edge ? ? 50 ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck2 is 66.7 ns. therefore, the sck2 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi2 pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 430 ? 2011-2013 microchip technology inc. figure 30-19: spi2 slave mo de (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing characteristics ss2 sck2 (ckp = 0 ) sck2 (ckp = 1 ) sdo2 sp50 sp60 sdi2 sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 30-1 for load conditions. sp36
? 2011-2013 microchip technology inc. ds70657g-page 431 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-38: spi2 slave mo de (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck2 input frequency ? ? lesser of f p or 11 mhz (note 3 ) sp72 tscf sck2 input fall time ? ? ? ns see parameter do32 (note 4 ) sp73 tscr sck2 input rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo2 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo2 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo2 data output valid after sck2 edge ? 6 20 ns sp36 tdov2sch, tdov2scl sdo2 data output setup to first sck2 edge 30 ? ? ns sp40 tdiv2sch, tdiv2scl setup time of sdi2 data input to sck2 edge 30 ? ? ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi2 data input to sck2 edge 30 ? ? ns sp50 tssl2sch, tssl2scl ss2 ? to sck2 ? or sck2 ?? input 120 ? ? ns sp51 tssh2doz ss2 ? to sdo2 output high-impedance 10 ? 50 ns (note 4 ) sp52 tsch2ssh tscl2ssh ss2 ?? after sck2 edge 1.5 t cy + 40 ? ? ns (note 4 ) sp60 tssl2dov sdo2 data output valid after ss2 edge ? ? 50 ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck2 is 91 ns. therefore, the sck2 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi2 pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 432 ? 2011-2013 microchip technology inc. figure 30-20: spi2 slave mo de (full-duplex, cke = 0 , ckp = 1 , smp = 0 ) timing characteristics ss 2 sck2 (ckp = 0 ) sck2 (ckp = 1 ) sdo2 sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 note: refer to figure 30-1 for load conditions. sdi2 sp36
? 2011-2013 microchip technology inc. ds70657g-page 433 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-39: spi2 slave mo de (full-duplex, cke = 0 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck2 input frequency ? ? 15 mhz (note 3 ) sp72 tscf sck2 input fall time ? ? ? ns see parameter do32 (note 4 ) sp73 tscr sck2 input rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo2 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo2 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo2 data output valid after sck2 edge ? 6 20 ns sp36 tdov2sch, tdov2scl sdo2 data output setup to first sck2 edge 30 ? ? ns sp40 tdiv2sch, tdiv2scl setup time of sdi2 data input to sck2 edge 30 ? ? ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi2 data input to sck2 edge 30 ? ? ns sp50 tssl2sch, tssl2scl ss2 ? to sck2 ? or sck2 ?? input 120 ? ? ns sp51 tssh2doz ss2 ? to sdo2 output high-impedance 10 ? 50 ns (note 4 ) sp52 tsch2ssh tscl2ssh ss2 ?? after sck2 edge 1.5 t cy + 40 ? ? ns (note 4 ) note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck2 is 66.7 ns. therefore, the sck2 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi2 pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 434 ? 2011-2013 microchip technology inc. figure 30-21: spi2 slave mo de (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing characteristics ss 2 sck2 (ckp = 0 ) sck2 (ckp = 1 ) sdo2 sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 note: refer to figure 30-1 for load conditions. sdi2 sp36
? 2011-2013 microchip technology inc. ds70657g-page 435 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-40: spi2 slave mo de (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck2 input frequency ? ? 11 mhz (note 3 ) sp72 tscf sck2 input fall time ? ? ? ns see parameter do32 (note 4 ) sp73 tscr sck2 input rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo2 data output fall time ? ? ? ns see parameter do31 (note 4 ) sp31 tdor sdo2 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo2 data output valid after sck2 edge ? 6 20 ns sp36 tdov2sch, tdov2scl sdo2 data output setup to first sck2 edge 30 ? ? ns sp40 tdiv2sch, tdiv2scl setup time of sdi2 data input to sck2 edge 30 ? ? ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi2 data input to sck2 edge 30 ? ? ns sp50 tssl2sch, tssl2scl ss2 ? to sck2 ? or sck2 ?? input 120 ? ? ns sp51 tssh2doz ss2 ? to sdo2 output high-impedance 10 ? 50 ns (note 4 ) sp52 tsch2ssh tscl2ssh ss2 ?? after sck2 edge 1.5 t cy + 40 ? ? ns (note 4 ) note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck2 is 91 ns. therefore, the sck2 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi2 pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 436 ? 2011-2013 microchip technology inc. table 30-41: spi1 maximu m data/clock rate summary figure 30-22: spi1 master mode ( half-duplex, transmit only, cke = 0 ) timing characteristics ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended maximum data rate master transmit only (half-duplex) master transmit/receive (full-duplex) slave transmit/receive (full-duplex) cke ckp smp 15 mhz table 30-42 ?? 0 , 10 , 10 , 1 10 mhz ? table 30-43 ? 10 , 11 10 mhz ? table 30-44 ? 00 , 11 15 mhz ? ? table 30-45 100 11 mhz ? ? table 30-46 110 15 mhz ? ? table 30-47 010 11 mhz ? ? table 30-48 000 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 30-1 for load conditions.
? 2011-2013 microchip technology inc. ds70657g-page 437 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 30-23: spi1 master mode ( half-duplex, transmit only, cke = 1 ) timing characteristics table 30-42: spi1 master mode (half-duple x, transmit only) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck1 frequency ? ? 15 mhz (note 3 ) sp20 tscf sck1 output fall time ? ? ? ns see parameter do32 (note 4 ) sp21 tscr sck1 output rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo1 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo1 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge ?620ns sp36 tdiv2sch, tdiv2scl sdo1 data output setup to first sck1 edge 30 ? ? ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 66.7 ns. therefore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi1 pins. sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 438 ? 2011-2013 microchip technology inc. figure 30-24: spi1 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing characteristics table 30-43: spi1 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck1 frequency ? ? 10 mhz (note 3 ) sp20 tscf sck1 output fall time ? ? ? ns see parameter do32 (note 4 ) sp21 tscr sck1 output rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo1 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo1 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge ?620ns sp36 tdov2sc, tdov2scl sdo1 data output setup to first sck1 edge 30 ??ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ??ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 30 ??ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 100 ns. the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi1 pins. sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36 sp41 msb in lsb in bit 14 - - - -1 sdi1 sp40
? 2011-2013 microchip technology inc. ds70657g-page 439 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 30-25: spi1 master mode (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing characteristics table 30-44: spi1 master mode (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck1 frequency ? ? 10 mhz -40oc to +125oc (note 3 ) sp20 tscf sck1 output fall time ? ? ? ns see parameter do32 (note 4 ) sp21 tscr sck1 output rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo1 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo1 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge ?620ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ??ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ??ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 30 ??ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 100 ns. the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi1 pins. sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sdi1 sp10 sp40 sp41 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 msb in lsb in bit 14 - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 440 ? 2011-2013 microchip technology inc. figure 30-26: spi1 slave mo de (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing characteristics ss1 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp50 sp60 sdi1 sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 30-1 for load conditions. sp36
? 2011-2013 microchip technology inc. ds70657g-page 441 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-45: spi1 slave mo de (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck1 input frequency ? ? lesser of f p or 15 mhz (note 3 ) sp72 tscf sck1 input fall time ? ? ? ns see parameter do32 (note 4 ) sp73 tscr sck1 input rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo1 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo1 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge ? 6 20 ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ? ? ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ? ? ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 30 ? ? ns sp50 tssl2sch, tssl2scl ss1 ? to sck1 ? or sck1 ?? input 120 ? ? ns sp51 tssh2doz ss1 ? to sdo1 output high-impedance 10 ? 50 ns (note 4 ) sp52 tsch2ssh tscl2ssh ss1 ?? after sck1 edge 1.5 t cy + 40 ? ? ns (note 4 ) sp60 tssl2dov sdo1 data output valid after ss1 edge ? ? 50 ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 66.7 ns. therefore, the sck1 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi1 pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 442 ? 2011-2013 microchip technology inc. figure 30-27: spi1 slave mo de (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing characteristics ss1 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp50 sp60 sdi1 sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 30-1 for load conditions. sp36
? 2011-2013 microchip technology inc. ds70657g-page 443 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-46: spi1 slave mo de (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck1 input frequency ? ? lesser of f p or 11 mhz (note 3 ) sp72 tscf sck1 input fall time ? ? ? ns see parameter do32 (note 4 ) sp73 tscr sck1 input rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo1 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo1 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge ? 6 20 ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ? ? ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ? ? ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 30 ? ? ns sp50 tssl2sch, tssl2scl ss1 ? to sck1 ? or sck1 ?? input 120 ? ? ns sp51 tssh2doz ss1 ? to sdo1 output high-impedance 10 ? 50 ns (note 4 ) sp52 tsch2ssh, tscl2ssh ss1 ?? after sck1 edge 1.5 t cy + 40 ? ? ns (note 4 ) sp60 tssl2dov sdo1 data output valid after ss1 edge ? ? 50 ns note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 91 ns. therefore, the sck1 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi1 pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 444 ? 2011-2013 microchip technology inc. figure 30-28: spi1 slave mo de (full-duplex, cke = 0 , ckp = 1 , smp = 0 ) timing characteristics ss 1 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 note: refer to figure 30-1 for load conditions. sdi1 sp36
? 2011-2013 microchip technology inc. ds70657g-page 445 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-47: spi1 slave mo de (full-duplex, cke = 0 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck1 input frequency ? ? 15 mhz (note 3 ) sp72 tscf sck1 input fall time ? ? ? ns see parameter do32 (note 4 ) sp73 tscr sck1 input rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo1 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo1 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge ? 6 20 ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ? ? ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ? ? ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 30 ? ? ns sp50 tssl2sch, tssl2scl ss1 ? to sck1 ? or sck1 ?? input 120 ? ? ns sp51 tssh2doz ss1 ? to sdo1 output high-impedance 10 ? 50 ns (note 4 ) sp52 tsch2ssh, tscl2ssh ss1 ?? after sck1 edge 1.5 t cy + 40 ? ? ns (note 4 ) note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 66.7 ns. therefore, the sck1 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi1 pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 446 ? 2011-2013 microchip technology inc. figure 30-29: spi1 slave mo de (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing characteristics ss 1 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 note: refer to figure 30-1 for load conditions. sdi1 sp36
? 2011-2013 microchip technology inc. ds70657g-page 447 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-48: spi1 slave mo de (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck1 input frequency ? ? 11 mhz (note 3 ) sp72 tscf sck1 input fall time ? ? ? ns see parameter do32 (note 4 ) sp73 tscr sck1 input rise time ? ? ? ns see parameter do31 (note 4 ) sp30 tdof sdo1 data output fall time ? ? ? ns see parameter do32 (note 4 ) sp31 tdor sdo1 data output rise time ? ? ? ns see parameter do31 (note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge ? 6 20 ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ? ? ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ? ? ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 30 ? ? ns sp50 tssl2sch, tssl2scl ss1 ? to sck1 ? or sck1 ?? input 120 ? ? ns sp51 tssh2doz ss1 ? to sdo1 output high-impedance 10 ? 50 ns (note 4 ) sp52 tsch2ssh, tscl2ssh ss1 ?? after sck1 edge 1.5 t cy + 40 ? ? ns (note 4 ) note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 91 ns. therefore, the sck1 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi1 pins.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 448 ? 2011-2013 microchip technology inc. figure 30-30: i2cx bus start/stop bits ti ming characteristics (master mode) figure 30-31: i2cx bus data timing characteristics (master mode) im31 im34 sclx sdax start condition stop condition im30 im33 note: refer to figure 30-1 for load conditions. im11 im10 im33 im11 im10 im20 im26 im25 im40 im40 im45 im21 sclx sdax in sdax out note: refer to figure 30-1 for load conditions.
? 2011-2013 microchip technology inc. ds70657g-page 449 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-49: i2cx bus data timing requirements (master mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 4 ) min. ( 1 ) max. units conditions im10 t lo : scl clock low time 100 khz mode t cy /2 (brg + 2) ? ? s 400 khz mode t cy /2 (brg + 2) ? ? s 1 mhz mode ( 2 ) t cy /2 (brg + 2) ? ? s im11 t hi : scl clock high time 100 khz mode t cy /2 (brg + 2) ? ? s 400 khz mode t cy /2 (brg + 2) ? ? s 1 mhz mode ( 2 ) t cy /2 (brg + 2) ? ? s im20 t f : scl sdax and sclx fall time 100 khz mode ? 300 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode ( 2 ) ? 100 ns im21 t r : scl sdax and sclx rise time 100 khz mode ? 1000 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode ( 2 ) ? 300 ns im25 t su : dat data input setup time 100 khz mode 250 ? ns 400 khz mode 100 ? ns 1 mhz mode ( 2 ) 40 ? ns im26 t hd : dat data input hold time 100 khz mode 0 ? ? s 400 khz mode 0 0.9 ? s 1 mhz mode ( 2 ) 0.2 ? ? s im30 t su : sta start condition setup time 100 khz mode t cy /2 (brg + 2) ? ? s only relevant for repeated start condition 400 khz mode t cy /2 (brg + 2) ? ? s 1 mhz mode ( 2 ) t cy /2 (brg + 2) ? ? s im31 t hd : sta start condition hold time 100 khz mode t cy /2 (brg + 2) ? ? s after this period, the first clock pulse is generated 400 khz mode t cy /2 (brg +2) ? ? s 1 mhz mode ( 2 ) t cy /2 (brg + 2) ? ? s im33 t su : sto stop condition setup time 100 khz mode t cy /2 (brg + 2) ? ? s 400 khz mode t cy /2 (brg + 2) ? ? s 1 mhz mode ( 2 ) t cy /2 (brg + 2) ? ? s im34 t hd : sto stop condition 100 khz mode t cy /2 (brg + 2) ? ? s hold time 400 khz mode t cy /2 (brg + 2) ? ? s 1 mhz mode ( 2 ) t cy /2 (brg + 2) ? ? s im40 t aa : scl output valid from clock 100 khz mode ? 3500 ns 400 khz mode ? 1000 ns 1 mhz mode ( 2 ) ? 400 ns im45 t bf : sda bus free time 100 khz mode 4.7 ? ? s time the bus must be free before a new transmission can start 400 khz mode 1.3 ? ? s 1 mhz mode ( 2 ) 0.5 ? ? s im50 c b bus capacitive loading ? 400 pf im51 t pgd pulse gobbler delay 65 390 ns (note 3 ) note 1: brg is the value of the i 2 c? baud rate generator. refer to section 19. ?inter-integrated circuit (i 2 c?)? (ds70330) in the ? dspic33e/pic24e family reference manual?. please see the microchip web site for the latest family reference manual sections. 2: maximum pin capacitance = 10 pf for all i2cx pins (for 1 mhz mode only). 3: typical value for this parameter is 130 ns. 4: these parameters are characterized, but not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 450 ? 2011-2013 microchip technology inc. figure 30-32: i2cx bus start/stop bits timing characteristics (slave mode) figure 30-33: i2cx bus data timing characteristics (slave mode) is31 is34 sclx sdax start condition stop condition is30 is33 is30 is31 is33 is11 is10 is20 is25 is40 is40 is45 is21 sclx sdax in sdax out is26
? 2011-2013 microchip technology inc. ds70657g-page 451 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-50: i2cx bus data timing requirements (slave mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. no. symbol characteristic ( 3 ) min. max. units conditions is10 t lo : scl clock low time 100 khz mode 4.7 ? ? s 400 khz mode 1.3 ? ? s 1 mhz mode ( 1 ) 0.5 ? ? s is11 t hi : scl clock high time 100 khz mode 4.0 ? ? s device must operate at a minimum of 1.5 mhz 400 khz mode 0.6 ? ? s device must operate at a minimum of 10 mhz 1 mhz mode ( 1 ) 0.5 ? ? s is20 t f : scl sdax and sclx fall time 100 khz mode ? 300 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode ( 1 ) ?100ns is21 t r : scl sdax and sclx rise time 100 khz mode ? 1000 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode ( 1 ) ?300ns is25 t su : dat data input setup time 100 khz mode 250 ? ns 400 khz mode 100 ? ns 1 mhz mode ( 1 ) 100 ? ns is26 t hd : dat data input hold time 100 khz mode 0 ? ? s 400 khz mode 0 0.9 ? s 1 mhz mode ( 1 ) 00.3 ? s is30 t su : sta start condition setup time 100 khz mode 4.7 ? ? s only relevant for repeated start condition 400 khz mode 0.6 ? ? s 1 mhz mode ( 1 ) 0.25 ? ? s is31 t hd : sta start condition hold time 100 khz mode 4.0 ? ? s after this period, the first clock pulse is generated 400 khz mode 0.6 ? ? s 1 mhz mode ( 1 ) 0.25 ? ? s is33 t su : sto stop condition setup time 100 khz mode 4.7 ? ? s 400 khz mode 0.6 ? ? s 1 mhz mode ( 1 ) 0.6 ? ? s is34 t hd : sto stop condition hold time 100 khz mode 4 ? ? s 400 khz mode 0.6 ? ? s 1 mhz mode ( 1 ) 0.25 ? s is40 t aa : scl output valid from clock 100 khz mode 0 3500 ns 400 khz mode 0 1000 ns 1 mhz mode ( 1 ) 0350ns is45 t bf : sda bus free time 100 khz mode 4.7 ? ? s time the bus must be free before a new transmission can start 400 khz mode 1.3 ? ? s 1 mhz mode ( 1 ) 0.5 ? ? s is50 c b bus capacitive loading ? 400 pf is51 t pgd pulse gobbler delay 65 390 ns (note 2 ) note 1: maximum pin capacitance = 10 pf for all i2cx pins (for 1 mhz mode only). 2: typical value for this parameter is 130 ns. 3: these parameters are characterized, but not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 452 ? 2011-2013 microchip technology inc. figure 30-34: ecanx module i/o timing characteristics table 30-51: ecanx module i/o timing requirements figure 30-35: uart x module i/o timing characteristics table 30-52: uartx module i/o timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions ca10 t io f port output fall time ? ? ? ns see parameter do32 ca11 t io r port output rise time ? ? ? ns see parameter do31 ca20 t cwf pulse width to trigger can wake-up filter 120 ? ? ns note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. parameters are for design guidance only and are not tested. ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +125c param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions ua10 t uabaud uartx baud time 66.67 ? ? ns ua11 f baud uartx baud frequency ? ? 15 mbps ua20 t cwf start bit pulse width to trigger uartx wake-up 500 ? ? ns note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. parameters are for design guidance only and are not tested. cxtx pin (output) ca10 ca11 old value new value ca20 cxrx pin (input) ua20 uxrx msb in lsb in bit 6-1 ua10 u x tx
? 2011-2013 microchip technology inc. ds70657g-page 453 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-53: op amp/comparator specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 2 ) max. units conditions comparator ac characteristics cm10 t resp response time ( 3 ) ? 19 ? ns v+ input step of 100 mv, v- input held at v dd /2 cm11 t mc 2 ov comparator mode change to output valid ??10s comparator dc characteristics cm30 v offset comparator offset voltage ?1040 mv cm31 v hyst input hysteresis voltage ( 3 ) ?30?mv cm32 t rise / t fall comparator output rise/ fall time ( 3 ) ? 20 ? ns 1 pf load capacitance on input cm33 v gain open-loop voltage gain ( 3 ) ?90? db cm34 v icm input common-mode voltage av ss ?av dd v op amp ac characteristics cm20 s r slew rate ( 3 ) ? 9 ? v/s 10 pf load cm21a p m phase margin (configuration a) ( 3 , 4 ) ? 55 ? degree g = 100v/v; 10 pf load cm21b p m phase margin (configuration b) ( 3 , 5 ) ? 40 ? degree g = 100v/v; 10 pf load cm22 g m gain margin (3) ? 20 ? db g = 100v/v; 10 pf load cm23a g bw gain bandwidth (configuration a) ( 3 , 4 ) ? 10 ? mhz 10 pf load cm23b g bw gain bandwidth (configuration b) ( 3 , 5 ) ? 6 ? mhz 10 pf load note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. 2: data in ?typ? column is at 3.3v, +25c unless otherwise stated. 3: parameter is characterized but not tested in manufacturing. 4: see figure 25-6 for configuration information. 5: see figure 25-7 for configuration information. 6: resistances can vary by 10% between op amps.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 454 ? 2011-2013 microchip technology inc. op amp dc characteristics cm40 v cmr common-mode input voltage range av ss ? av dd v cm41 c mrr common-mode rejection ratio ( 3 ) ?40? dbv cm = av dd /2 cm42 v offset op amp offset voltage ( 3 ) ? 5? mv cm43 v gain open-loop voltage gain ( 3 ) ?90? db cm44 i os input offset current ? ? ? ? see pad leakage currents in table 30-11 cm45 i b input bias current ? ? ? ? see pad leakage currents in table 30-11 cm46 i out output current ? ? 420 a with minimum value of r feedback (cm48) cm48 r feedback feedback resistance value 8??k ? cm49a v oadc output voltage measured at oax using adc ( 3 , 4 ) av ss + 0.077 av ss + 0.037 av ss + 0.018 ? ? ? av dd ? 0.077 av dd ? 0.037 av dd ? 0.018 v v v i out = 420 a i out = 200 a i out = 100 a cm49b v out output voltage measured at oaxout pin ( 3 , 4 , 5 ) av ss + 0.210 av ss + 0.100 av ss + 0.050 ? ? ? av dd ? 0.210 av dd ? 0.100 av dd ? 0.050 v v v i out = 420 a i out = 200 a i out = 100 a cm51 r int 1 ( 6 ) internal resistance 1 (configuration a and b) ( 3 , 4 , 5 ) 198 264 317 ? min = -40oc typ = +25oc max = +125oc table 30-53: op amp/comparator specifications (continued) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 2 ) max. units conditions note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. 2: data in ?typ? column is at 3.3v, +25c unless otherwise stated. 3: parameter is characterized but not tested in manufacturing. 4: see figure 25-6 for configuration information. 5: see figure 25-7 for configuration information. 6: resistances can vary by 10% between op amps.
? 2011-2013 microchip technology inc. ds70657g-page 455 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-55: op amp/comparator vo ltage reference specifications table 30-54: op amp/comparator voltage re ference settling time specifications ac characteristics standard operating conditions (see note 2 ): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic min. typ. max. units conditions vr310 t set settling time ? 1 10 ? s (note 1 ) note 1: settling time is measured while cvrr = 1 and cvr<3:0> bits transition from ? 0000 ? to ? 1111 ?. 2: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. dc characteristics standard operating conditions (see note 1 ): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristics min. typ. max. units conditions vrd310 cv res resolution cv rsrc /24 ? cv rsrc /32 lsb vrd311 cvr aa absolute accuracy ( 2 ) ?25?mvcv rsrc = 3.3v vrd313 cv rsrc input reference voltage 0 ? av dd + 0.3 v vrd314 cvr out buffer output resistance ( 2 ) ?1.5k? ? note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. 2: parameter is characterized but not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 456 ? 2011-2013 microchip technology inc. table 30-56: ctmu current source specifications dc characteristics standard operating conditions:3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions ctmu current source ctmui1 i out 1 base range ( 1 ) 0.29 ? 0.77 a ctmuicon<9:8> = 01 ctmui2 i out 2 10x range ( 1 ) 3.85 ? 7.7 a ctmuicon<9:8> = 10 ctmui3 i out 3 100x range ( 1 ) 38.5 ? 77 a ctmuicon<9:8> = 11 ctmui4 i out 4 1000x range ( 1 ) 385 ? 770 a ctmuicon<9:8> = 00 ctmufv1 v f temperature diode forward voltage ( 1 , 2 ) ?0.598? vt a = +25oc, ctmuicon<9:8> = 01 ?0.658? vt a = +25oc, ctmuicon<9:8> = 10 ?0.721? vt a = +25oc, ctmuicon<9:8> = 11 ctmufv2 v fvr temperature diode rate of change ( 1 , 2 , 3 ) ? -1.92 ? mv/oc ctmuicon<9:8> = 01 ? -1.74 ? mv/oc ctmuicon<9:8> = 10 ? -1.56 ? mv/oc ctmuicon<9:8> = 11 note 1: nominal value at center point of current trim range (ctmuicon<15:10> = 000000 ). 2: parameters are characterized but not tested in manufacturing. 3: measurements taken with the following conditions: ?v ref + = av dd = 3.3v ? adc configured for 10-bit mode ? adc module configured for conversion speed of 500 ksps ? all pmdx bits are cleared (pmdx = 0 ) ? executing a while(1) statement ? device operating from the frc with no pll
? 2011-2013 microchip technology inc. ds70657g-page 457 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-57: adc mo dule specifications ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions device supply ad01 av dd module v dd supply greater of v dd ? 0.3 or 3.0 ? lesser of v dd + 0.3 or 3.6 v ad02 av ss module v ss supply v ss ? 0.3 ? v ss + 0.3 v reference inputs ad05 v refh reference voltage high av ss + 2.5 ? av dd vv refh = v ref + v refl = v ref - (note 1 ) ad05a 3.0 ? 3.6 v v refh = av dd v refl = av ss = 0 ad06 v refl reference voltage low av ss ?av dd ? 2.5 v (note 1 ) ad06a 0 ? 0 v v refh = av dd v refl = av ss = 0 ad07 v ref absolute reference voltage 2.5 ? 3.6 v v ref = v refh - v refl ad08 i ref current drain ? ? ? ? 10 600 ? a ? a adc off adc on ad09 i ad operating current ( 2 ) ? 5 ? ma adc operating in 10-bit mode (note 1 ) ? 2 ? ma adc operating in 12-bit mode (note 1 ) analog input ad12 v inh input voltage range v inh v inl ?v refh v this voltage reflects sample-and- hold channels 0, 1, 2 and 3 (ch0-ch3), positive input ad13 v inl input voltage range v inl v refl ?av ss + 1v v this voltage reflects sample-and- hold channels 0, 1, 2 and 3 (ch0-ch3), negative input ad17 r in recommended impedance of analog voltage source ??200 ? impedance to achieve maximum performance of adc note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. 2: parameter is characterized but not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 458 ? 2011-2013 microchip technology inc. table 30-58: adc module speci fications (12-bit mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions adc accuracy (12-bit mode) ad20a nr resolution 12 data bits bits ad21a inl integral nonlinearity -2.5 ? 2.5 lsb -40c ? t a ? +85c (note 2 ) -5.5 ? 5.5 lsb +85c ? t a ? +125c (note 2 ) ad22a dnl differential nonlinearity -1 ? 1 lsb -40c ? t a ? +85c (note 2 ) -1 ? 1 lsb +85c ? t a ? +125c (note 2 ) ad23a g err gain error ( 3 ) -10 ? 10 lsb -40c ? t a ? +85c (note 2 ) -10 ? 10 lsb +85c ? t a ? +125c (note 2 ) ad24a e off offset error -5 ? 5 lsb -40c ? t a ? +85c (note 2 ) -5 ? 5 lsb +85c ? t a ? +125c (note 2 ) ad25a ? monotonicity ? ? ? ? guaranteed dynamic performance (12-bit mode) ad30a thd total harmonic distortion ( 3 ) ?75?db ad31a sinad signal to noise and distortion ( 3 ) ?68?db ad32a sfdr spurious free dynamic range ( 3 ) ?80?db ad33a f nyq input signal bandwidth ( 3 ) ?250?khz ad34a enob effective number of bits ( 3 ) 11.09 11.3 ? bits note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. 2: for all accuracy specifications, v inl = av ss = v refl = 0v and av dd = v refh = 3.6v. 3: parameters are characterized but not tested in manufacturing.
? 2011-2013 microchip technology inc. ds70657g-page 459 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-59: adc module speci fications (10-bit mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions adc accuracy (10-bit mode) ad20b nr resolution 10 data bits bits ad21b inl integral nonlinearity -0.625 ? 0.625 lsb -40c ? t a ? +85c (note 2 ) -1.5 ? 1.5 lsb +85c ? t a ? +125c (note 2 ) ad22b dnl differential nonlinearity -0.25 ? 0.25 lsb -40c ? t a ? +85c (note 2 ) -0.25 ? 0.25 lsb +85c ? t a ? +125c (note 2 ) ad23b g err gain error -2.5 ? 2.5 lsb -40c ? t a ? +85c (note 2 ) -2.5 ? 2.5 lsb +85c ? t a ? +125c (note 2 ) ad24b e off offset error -1.25 ? 1.25 lsb -40c ? t a ? +85c (note 2 ) -1.25 ? 1.25 lsb +85c ? t a ? +125c (note 2 ) ad25b ? monotonicity ? ? ? ? guaranteed dynamic performance (10-bit mode) ad30b thd total harmonic distortion ( 3 ) ?64?db ad31b sinad signal to noise and distortion ( 3 ) ?57?db ad32b sfdr spurious free dynamic range ( 3 ) ?72?db ad33b f nyq input signal bandwidth ( 3 ) ?550?khz ad34b enob effective number of bits ( 3 ) ?9.4?bits note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. 2: for all accuracy specifications, v inl = av ss = v refl = 0v and av dd = v refh = 3.6v. 3: parameters are characterized but not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 460 ? 2011-2013 microchip technology inc. figure 30-36: adc conversion (12- bit mode) timing characteristics (asam = 0 , ssrc<2:0> = 000 , ssrcg = 0 ) ad55 t samp clear samp set samp ad61 adclk instruction samp ad60 done ad1if 1 2 3 4 5 6 8 7 1 ? software sets ad1con1. samp to start sampling. 2 ? sampling starts after discharge period. t samp is described in 3 ? software clears ad1con1. samp to start conversion. 4 ? sampling ends, conversion sequence starts. 5 ? convert bit 11. 9 ? one t ad for end of conversion. ad50 9 6 ? convert bit 10. 7 ? convert bit 1. 8 ? convert bit 0. execution ?dspic33e/pic24e family reference manual? . section 16. ?analog-to-digital converter (adc)? (ds70621) of the
? 2011-2013 microchip technology inc. ds70657g-page 461 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-60: adc conversion (12-bit mode) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions clock parameters ad50 t ad adc clock period 117.6 ? ? ns ad51 t rc adc internal rc oscillator period ( 2 ) ?250? ns conversion rate ad55 t conv conversion time ? 14 t ad ns ad56 f cnv throughput rate ? ? 500 ksps ad57a t samp sample time when sampling any anx input 3 t ad ?? ? ad57b t samp sample time when sampling the op amp outputs (configuration a and configuration b) ( 4 , 5 ) 3 t ad ?? ? timing parameters ad60 t pcs conversion start from sample trigger ( 2 , 3 ) 2 t ad ?3 t ad ? auto-convert trigger is not selected ad61 t pss sample start from setting sample (samp) bit ( 2 , 3 ) 2 t ad ?3 t ad ? ad62 t css conversion completion to sample start (asam = 1 ) ( 2 , 3 ) ? 0.5 t ad ?? ad63 t dpu time to stabilize analog stage from adc off to adc on ( 2 , 3 ) ??20 ? s (note 6 ) note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. 2: parameters are characterized but not tested in manufacturing. 3: because the sample caps will eventually lose charge, clock rates below 10 khz may affect linearity performance, especially at elevated temperatures. 4: see figure 25-6 for configuration information. 5: see figure 25-7 for configuration information. 6: the parameter, t dpu , is the time required for the adc module to stabilize at the appropriate level when the module is turned on (adon (ad1con1<15>) = 1 ). during this time, the adc result is indeterminate.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 462 ? 2011-2013 microchip technology inc. figure 30-37: adc conversion (10- bit mode) timing characteristics (chps<1:0> = 01 , simsam = 0 , asam = 0 , ssrc<2:0> = 000 , ssrcg = 0 ) figure 30-38: adc conversion (10-bit mode) timing characteristics (chps<1:0> = 01 , simsam = 0 , asam = 1 , ssrc<2:0> = 111 , ssrcg = 0 , samc<4:0> = 00010 ) ad55 t samp clear samp set samp ad61 adclk instruction samp ad60 done ad1if 1 2 3 4 5 6 8 5 6 7 1 ? software sets ad1con1. samp to start sampling. 2 ? sampling starts after discharge period. t samp is described in 3 ? software clears ad1con1. samp to start conversion. 4 ? sampling ends, conversion sequence starts. 5 ? convert bit 9. 8 ? one t ad for end of conversion. ad50 7 ad55 8 6 ? convert bit 8. 7 ? convert bit 0. execution ?dspic33e/pic24e family reference manual? . section 16. ?analog-to-digital converter (adc)? (ds70621) of the 1 2 3 4 5 6 4 5 6 8 1 ? software sets ad1con1. adon to start ad operation. 2 ? sampling starts after discharge period. t samp is described in 3 ? convert bit 9. 4 ? convert bit 8. 5 ? convert bit 0. 7 3 6 ? one t ad for end of conversion. 7 ? begin conversion of next channel. 8 ? sample for time specified by samc<4:0>. adclk instruction set adon execution samp t samp ad1if done ad55 ad55 t samp ad55 ad50 section 16. ?analog-to-digital converter (adc)? (ds70621) of the ?dspic33e/pic24e family reference manual? . ad62
? 2011-2013 microchip technology inc. ds70657g-page 463 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 30-61: adc conversion (10-bit mode) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions clock parameters ad50 t ad adc clock period 76 ? ? ns ad51 t rc adc internal rc oscillator period ( 2 ) ?250? ns conversion rate ad55 t conv conversion time ? 12 t ad ?? ad56 f cnv throughput rate ? ? 1.1 msps using simultaneous sampling ad57a t samp sample time when sampling any anx input 2 t ad ??? ad57b t samp sample time when sampling the op amp outputs (configuration a and configuration b) ( 4 , 5 ) 4 t ad ??? timing parameters ad60 t pcs conversion start from sample trigger ( 2, 3 ) 2 t ad ?3 t ad ? auto-convert trigger is not selected ad61 t pss sample start from setting sample (samp) bit ( 2, 3 )) 2 t ad ?3 t ad ? ad62 t css conversion completion to sample start (asam = 1 ) ( 2, 3 ) ?0.5 t ad ?? ad63 t dpu time to stabilize analog stage from adc off to adc on ( 2, 3 ) ??20 ? s (note 6 ) note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, op amp/comparator and comparator voltage reference) may have degraded performance. refer to parameter bo10 in table 30-13 for the minimum and maximum bor values. 2: parameters are characterized but not tested in manufacturing. 3: because the sample caps will eventually lose charge, clock rates below 10 khz may affect linearity performance, especially at elevated temperatures. 4: see figure 25-6 for configuration information. 5: see figure 25-7 for configuration information. 6: the parameter, t dpu , is the time required for the adc module to stabilize at the appropriate level when the module is turned on (adon (ad1con1<15>) = 1 ). during this time, the adc result is indeterminate. table 30-62: dma module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. characteristic min. typ. ( 1 ) max. units conditions dm1 dma byte/word transfer latency 1 t cy ( 2 ) ??ns note 1: these parameters are characterized, but not tested in manufacturing. 2: because dma transfers use the cpu data bus, this time is dependent on other functions on the bus.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 464 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 465 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 31.0 high-temperature el ectrical characteristics this section provides an overview of dspi c33epxxxgp50x, dspic33epxxxmc2 0x/50x and pic24epxxxgp/ mc20x electrical characteristics for devices operating in an ambient temperature range of -40c to +150c. the specifications between -40c to +150c are identical to those shown in section 30.0 ?electrical characteristics? for operation between -40c to +125c, with the exception of the parameters listed in this section. parameters in this section begin with an h, which denotes high temperature. for example, parameter dc10 in section 30.0 ?electrical characteristics? is the industrial and extended temperature equivalent of hdc10. absolute maximum ratings for the dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x high-temperature devices are listed below. exposure to these maximum rating conditions for extended periods can affect device reliability. functional operation of the device at these or any other conditions above the parameters indicated in the operation listings of this specification is not implied. absolute maximum ratings ( 1 ) ambient temperature under bias ( 2 ) .........................................................................................................-40c to +150c storage temperature ............................................................................................................ .................. -65c to +160c voltage on v dd with respect to v ss ......................................................................................................... -0.3v to +4.0v voltage on any pin that is not 5v tolerant with respect to v ss ( 3 ) .................................................... -0.3v to (v dd + 0.3v) voltage on any 5v tolerant pin with respect to v ss when v dd < 3.0v ( 3 ) .................................................... -0.3v to 3.6v voltage on any 5v tolerant pin with respect to v ss when v dd ? 3.0v ( 3 ) .................................................... -0.3v to 5.5v maximum current out of v ss pin ........................................................................................................................... ..60 ma maximum current into v dd pin ( 4 ) .............................................................................................................................60 ma maximum junction temperature................................................................................................... .......................... +155c maximum current sourced/sunk by any 4x i/o pin ................................................................................. .................10 ma maximum current sourced/sunk by any 8x i/o pin ................................................................................. .................15 ma maximum current sunk by all ports combined .................................................................................... ....................70 ma maximum current sourced by all ports combined ( 4 ) ................................................................................................70 ma note 1: stresses above those listed under ?absolute maximum ratings? can cause permanent damage to the device. this is a stress rating only, and functional operation of the device at those or any other conditions above those indicated in the operation listings of this specification is not implied. exposure to maximum rating conditions for extended periods can affect device reliability. 2: aec-q100 reliability testing for devices intended to operate at +150c is 1,000 hours. any design in which the total operating time from +125c to +150c will be greater than 1,000 hours is not warranted without prior written approval from microchip technology inc. 3: refer to the ? pin diagrams ? section for 5v tolerant pins. 4: maximum allowable current is a function of device maximum power dissipation (see tab l e 3 1- 2 ).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 466 ? 2011-2013 microchip technology inc. 31.1 high-temperature dc characteristics table 31-1: operating mips vs. voltage table 31-2: thermal operating conditions table 31-3: dc temperature and voltage specifications characteristic v dd range (in volts) temperature range (in c) max mips dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x hdc5 3.0 to 3.6v ( 1 ) -40c to +150c 40 note 1: device is functional at v bormin < v dd < v ddmin . analog modules, such as the adc, may have degraded performance. device functionality is tested but not characterized. rating symbol min typ max unit high-temperature devices operating junction temperature range t j -40 ? +155 c operating ambient temperature range t a -40 ? +150 c power dissipation: internal chip power dissipation: p int = v dd x (i dd ? ? i oh ) p d p int + p i / o w i/o pin power dissipation: i/o = ? ({v dd ? v oh } x i oh ) + ? (v ol x i ol ) maximum allowed power dissipation p dmax (t j ? t a )/ ? ja w dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c parameter no. symbol characteristic min typ max units conditions operating voltage hdc10 supply voltage v dd ? 3.0 3.3 3.6 v -40c to +150c
? 2011-2013 microchip technology inc. ds70657g-page 467 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 31-4: dc characteristics: power-down current (i pd ) table 31-5: dc characteristics: operating current (i dd ) table 31-6: dc characteristics: doze current (i doze ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c parameter no. typical max units conditions power-down current (i pd ) hdc60e 750 2500 ? a +150c 3.3v base power-down current (notes 1 , 3 ) hdc61c 15 ? ? a +150c 3.3v watchdog timer current: ? i wdt (notes 2 , 4 ) note 1: base i pd is measured with all peripherals and clocks shut down. all i/os are configured as inputs and pulled to v ss . wdt, etc., are all switched off and vregs (rcon<8>) = 1 . 2: the ? current is the additional current consumed when the module is enabled. this current should be added to the base i pd current. 3: these currents are measured on the device containing the most memory in this family. 4: these parameters are characterized, but are not tested in manufacturing. dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c parameter no. typical max units conditions hdc20 9 15 ma +150c 3.3v 10 mips hdc22 16 25 ma +150c 3.3v 20 mips hdc23 30 50 ma +150c 3.3v 40 mips dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c parameter no. typical max doze ratio units conditions hdc72a 24 35 1:2 ma +150c 3.3v 40 mips hdc72f ( 1 ) 14 ? 1:64 ma hdc72g ( 1 ) 12 ? 1:128 ma note 1: parameters with doze ratios of 1:64 and 1:128 are characterized, but are not tested in manufacturing.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 468 ? 2011-2013 microchip technology inc. table 31-7: dc characteristics: i/o pin output specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c param. symbol characteristic min. typ. max. units conditions hdo10 v ol output low voltage 4x sink driver pins ( 2 ) ??0.4vi ol ? 5ma, v dd = 3.3v (note 1 ) output low voltage 8x sink driver pins ( 3 ) ??0.4vi ol ? 8 ma, v dd = 3.3v (note 1 ) hdo20 v oh output high voltage 4x source driver pins ( 2 ) 2.4 ? ? v i oh ? -10 ma, v dd = 3.3v (note 1 ) output high voltage 8x source driver pins ( 3 ) 2.4 ? ? v i oh ? 15 ma, v dd = 3.3v (note 1 ) hdo20a v oh 1 output high voltage 4x source driver pins ( 2 ) 1.5 ? ? v i oh ? -3.9 ma, v dd = 3.3v (note 1 ) 2.0 ? ? i oh ? -3.7 ma, v dd = 3.3v (note 1 ) 3.0 ? ? i oh ? -2 ma, v dd = 3.3v (note 1 ) output high voltage 8x source driver pins ( 3 ) 1.5 ? ? v i oh ? -7.5 ma, v dd = 3.3v (note 1 ) 2.0 ? ? i oh ? -6.8 ma, v dd = 3.3v (note 1 ) 3.0 ? ? i oh ? -3 ma, v dd = 3.3v (note 1 ) note 1: parameters are characterized, but not tested. 2: includes all i/o pins that are not 8x sink driver pins (see below). 3: includes the following pins: for devices with less than 64 pins: ra3, ra4, ra9, rb<7:15> and rc3 for 64-pin devices: ra4, ra9, rb<7:15>, rc3 and rc15
? 2011-2013 microchip technology inc. ds70657g-page 469 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 31.2 ac characteristics and timing parameters the information contained in this section defines dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ac characteristics and timing parameters for high-temperature devices. however, all ac timing specifications in this section are the same as those in section 30.2 ?ac characteristics and timing parameters? , with the exception of the parameters listed in this section. parameters in this section begin with an h, which denotes high temperature. for example, parameter os53 in section 30.2 ?ac characteristics and timing parameters? is the industrial and extended temperature equivalent of hos53. table 31-8: temperature and volt age specifications ? ac figure 31-1: load conditions for device timing specifications table 31-9: pll clock timing specifications ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c operating voltage v dd range as described in table 31-1 . ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c param no. symbol characteristic min typ max units conditions hos53 d clk clko stability (jitter) ( 1 ) -5 0.5 5 % measured over 100 ms period note 1: these parameters are characterized by similarity, but are not tested in manufacturing. this specification is based on clock cycle by clock cycle measurements. to calculate the effective jitter for individual time bases or communication clocks use this formula: v dd /2 c l r l pin pin v ss v ss c l r l =464 ? c l = 50 pf for all pins except osc2 15 pf for osc2 output load condition 1 ? for all pins except osc2 load condition 2 ? for osc2 peripheral clock jitter d clk f osc peripheral bit rate clock -------------------------------------------------------------- ?? ?? ----------------------------------------------------------------------- - = for example: f osc = 32 mhz, d clk = 5%, spix bit rate clock (i.e., sckx) is 2 mhz. spi sck jitter d clk 32 mhz 2 mhz -------------------- ?? ?? ----------------------------- - 5% 16 --------- - 5% 4 ------- - 1.25% ====
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 470 ? 2011-2013 microchip technology inc. table 31-10: internal rc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c param no. characteristic min typ max units conditions lprc @ 32.768 khz ( 1 , 2 ) hf21 lprc -30 ? +30 % -40c ? t a ?? +150c v dd = 3.0-3.6v note 1: change of lprc frequency as v dd changes. 2: lprc accuracy impacts the watchdog timer time-out period (t wdt 1). see section 27.5 ?watchdog timer (wdt)? for more information.
? 2011-2013 microchip technology inc. ds70657g-page 471 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x table 31-11: adc module speci fications (12-bit mode) table 31-12: adc module speci fications (10-bit mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c param no. symbol characteristic min typ max units conditions adc accuracy (12-bit mode) ( 1 ) had20a nr resolution ( 3 ) 12 data bits bits had21a inl integral nonlinearity -5.5 ? 5.5 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v had22a dnl differential nonlinearity -1 ? 1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v had23a g err gain error -10 ? 10 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v had24a e off offset error -5 ? 5 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v dynamic performance (12-bit mode) ( 2 ) had33a f nyq input signal bandwidth ? ? 200 khz note 1: these parameters are characterized, but are tested at 20 ksps only. 2: these parameters are characterized by similarity, but are not tested in manufacturing. 3: injection currents > | 0 | can affect the adc results by approximately 4-6 counts. ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +150c param no. symbol characteristic min typ max units conditions adc accuracy (10-bit mode) ( 1 ) had20b nr resolution ( 3 ) 10 data bits bits had21b inl integral nonlinearity -1.5 ? 1.5 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v had22b dnl differential nonlinearity -0.25 ? 0.25 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v had23b g err gain error -2.5 ? 2.5 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v had24b e off offset error -1.25 ? 1.25 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v dynamic performance (10-bit mode) ( 2 ) had33b f nyq input signal bandwidth ? ? 400 khz note 1: these parameters are characterized, but are tested at 20 ksps only. 2: these parameters are characterized by similarity, but are not tested in manufacturing. 3: injection currents > | 0 | can affect the adc results by approximately 4-6 counts.
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 472 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 473 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 32.0 dc and ac device characteristics graphs figure 32-1: v oh ? 4x driver pins figure 32-2: v oh ? 8x driver pins figure 32-3: v ol ? 4x driver pins figure 32-4: v ol ? 8x driver pins note: the graphs provided following this note are a statistical summary based on a limited number of samples and are provided for des ign guidance purposes only. the performance characteristics listed herein are not tested or guaranteed. in some graphs, the data presented may be out side the specified operating range (e.g., outside specified power supply range) and therefore, outside the warranted range. -0.050 -0.045 -0.040 -0.035 -0.030 -0.025 -0.020 ioh(a) voh (v) -0.050 -0.045 -0.040 -0.035 -0.030 -0.025 -0.020 -0.015 -0.010 -0.005 0.000 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) voh (v) 3v 3.3v 3.6v absolute maximum -0.080 -0.070 -0.060 -0.050 -0.040 0 030 ioh(a) voh(v) -0.080 -0.070 -0.060 -0.050 -0.040 -0.030 -0.020 -0.010 0.000 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) voh(v) v v v a 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 ioh(a) vol(v) 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) vol(v) v v v a 0020 0.030 0.040 0.050 0.060 0.070 0.080 ioh(a) vol(v) 8x 0.000 0.010 0.020 0.030 0.040 0.050 0.060 0.070 0.080 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) vol(v) 8x v v v a
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 474 ? 2011-2013 microchip technology inc. figure 32-5: typical i pd current @ v dd = 3.3v figure 32-6: typical i dd current @ v dd = 3.3v figure 32-7: typical i doze current @ v dd = 3.3v figure 32-8: typical i idle current @ v dd = 3.3v 200.00 300.00 400.00 500.00 600.00 700.00 800.00 i pd current (a) 0.00 100.00 200.00 300.00 400.00 500.00 600.00 700.00 800.00 -40-30-20-10 0 102030405060708090100110120 i pd current (a) temperature (celsius) 0 10 20 30 40 50 0 20406080 32k 64k 128k 256k mips i dd (ma) 15.00 20.00 25.00 30.00 35.00 40.00 45.00 o ze current (ma) 0.00 5.00 10.00 15.00 20.00 25.00 30.00 35.00 40.00 45.00 1:1 1:2 1:4 1:8 1:16 1:32 1:64 1:128 i doze current (ma) doze ratio 10.00 15.00 20.00 25.00 idle current (ma) 0.00 5.00 10.00 15.00 20.00 25.00 0 10203040506070 i idle current (ma) mips i idle (ec) i idle (ec+pll)
? 2011-2013 microchip technology inc. ds70657g-page 475 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x figure 32-9: typical frc frequency @ v dd = 3.3v figure 32-10: typical lprc frequency @ v dd = 3.3v figure 32-11: typical ctmu temperature diode forward voltage 7310 7320 7330 7340 7350 7360 7370 7380 frc frequency (khz) 7280 7290 7300 7310 7320 7330 7340 7350 7360 7370 7380 -40-30-20-10 0 102030405060708090100110120 frc frequency (khz) temperature (celsius) 31 32 33 lprc frequency (khz) 30 31 32 33 -40-30-20-10 0 102030405060708090100110120 lprc frequency (khz) temperature (celsius) 0.550 0.600 0.650 0.700 0.750 0.800 0.850 forward voltage (v) 0.350 0.400 0.450 0.500 0.550 0.600 0.650 0.700 0.750 0.800 0.850 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 forward voltage (v) temperature (celsius) v f = 0.598 v f = 0.658 v f = 0.721 6 5 a , v f v r = - 1 . 5 6 m v / o c 6 . 5 a , v f v r = - 1 . 7 4 m v / o c 0 . 6 5 a , v f v r = - 1 . 9 2 m v / o c
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 476 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 477 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 33.0 packaging information 33.1 package marking information legend: xx...x customer-specific information y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week ?01?) nnn alphanumeric traceability code pb-free jedec designator for matte tin (sn) * this package is pb-free. the pb-free jedec designator ( ) can be found on the outer packaging for this package. note: in the event the full microchip part number cannot be marked on one line, it will be carried over to the next line, thus limiting the number of available characters for customer-specific information. 3 e 3 e 28-lead spdip xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx yywwnnn example dspic33ep64gp 1310017 502-i/sp 3 e 28-lead soic (.300?) xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx yywwnnn example dspic33ep64gp 1310017 502-i/so 3 e 28-lead ssop xxxxxxxxxxxx xxxxxxxxxxxx yywwnnn example dspic33ep64 gp502-i/ss 1310017 3 e xxxxxxxx 28-lead qfn-s (6x6x0.9 mm) xxxxxxxx yywwnnn 33ep64gp example 502-i/mm 1310017
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 478 ? 2011-2013 microchip technology inc. 33.1 package marking information (continued) xxxxxxxxxx 36-lead vtla (tla) xxxxxxxxxx xxxxxxxxxx yywwnnn example xxxxxxxxxx 44-lead vtla (tla) xxxxxxxxxx xxxxxxxxxx yywwnnn 504-i/tl 1310017 33ep64gp 3 e example 504-i/tl 1310017 33ep64gp 3 e 44-lead tqfp xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx yywwnnn example 33ep64gp 504-i/pt 1310017 3 e xxxxxxxxxxx 44-lead qfn (8x8x0.9 mm) xxxxxxxxxxx xxxxxxxxxxx yywwnnn 33ep64gp example 504-i/ml 1310017 3 e
? 2011-2013 microchip technology inc. ds70657g-page 479 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 33.1 package marking information (continued) xxxxxxxxxxx 64-lead qfn (9x9x0.9 mm) xxxxxxxxxxx xxxxxxxxxxx yywwnnn dspic33ep example 64gp506 1310017 3 e -i/mr 64-lead tqfp (10x10x1 mm) xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx yywwnnn example dspic33ep 64gp506 1310017 -i/pt 3 e
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 480 ? 2011-2013 microchip technology inc. 33.2 package details 
       
      
 !"   !"#$%&" '  ()"&'"!&)
&#*& &  & #   +%&,  & !& - '!
!#.#

&"#'
#%! 

& "!
!
#%! 

& "!
!! 
&$#/  !#  '!
#&
   .0 1,2 1!'!
 
&$& "!
**&
"&&
 ! !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4 6&! 7,8. '!
9'&! 7 7: ; 7"') 
%! 7 < &  1,
&
&  = =  
##4 4!!   -  1!&
&   = = 
"# &

"# >#& .  - -- 
##4>#& .  <  :  9&  - -?   &
& 9  -  9# 4!!  <   6  9#>#& )    9
* 9#>#& )  <  :  
* + 1 = = - note 1 n 12 d e1 eb c e l a2 e b b1 a1 a 3 
   

  * ,1
? 2011-2013 microchip technology inc. ds70657g-page 481 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 482 ? 2011-2013 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011-2013 microchip technology inc. ds70657g-page 483 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 484 ? 2011-2013 microchip technology inc.   
#$
 %  
  &'   
% !"   !"#$%&" '  ()"&'"!&)
&#*& &  & #   '!
!#.#

&"#'
#%! 

& "!
!
#%! 

& "!
!! 
&$#''  !# - '!
#&
   .0 1,2 1!'!
 
&$& "!
**&
"&&
 ! .32 % '!
("!"*&
"&&
 (%
%
'&
 "
!!
 !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4 6&! 99. . '!
9'&! 7 7: ; 7"') 
%! 7 < &  ?1, :  8 &  = =  
##4 4!!  ?  < &#
%%   = = :  >#& .  < < 
##4>#& .  - ? :  9&     3
&9& 9    3
& & 9 .3 9# 4!!   =  3
& @ @ <@ 9#>#& )  = -< l l1 c a2 a1 a e e1 d n 1 2 note 1 b e 
   

  * ,-1
? 2011-2013 microchip technology inc. ds70657g-page 485 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 486 ? 2011-2013 microchip technology inc.
? 2011-2013 microchip technology inc. ds70657g-page 487 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 488 ? 2011-2013 microchip technology inc.    ( )* !   + ,,  -.-.'/   ()!
0 # '1  2   +# !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4
? 2011-2013 microchip technology inc. ds70657g-page 489 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 490 ? 2011-2013 microchip technology inc.
? 2011-2013 microchip technology inc. ds70657g-page 491 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 492 ? 2011-2013 microchip technology inc.
? 2011-2013 microchip technology inc. ds70657g-page 493 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 11   3# ( )4 3  5.5.5  * '  3() !"   !"#$%&" '  ()"&'"!&)
&#*& &  & #   , '% !&
 ! 
&
a!b'   - '!
!#.#

&"#'
#%! 

& "!
!
#%! 

& "!
!! 
&$#''  !#  '!
#&
   .0 1,2 1!'!
 
&$& "!
**&
"&&
 ! .32 % '!
("!"*&
"&&
 (%
%
'&
 "
!!
 !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4 6&! 99. . '!
9'&! 7 7: ; 7"') 
%9#! 7  9#&  <1, :  8 &  = =  
##4 4!!     &#
%%   =  3
&9& 9  ?  3
& & 9 .3 3
& @ -@ @ :  >#& . 1, :  9&  1, 
##4>#& . 1, 
##49&  1, 9# 4!!   =  9#>#& ) - -  
# %&
@ @ -@ 
# %&1
&&
' @ @ -@ a e e1 d d1 e b note 1 note 2 n 123 c a1 l a2 l1 
   

  * ,?1
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 494 ? 2011-2013 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011-2013 microchip technology inc. ds70657g-page 495 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 496 ? 2011-2013 microchip technology inc.
? 2011-2013 microchip technology inc. ds70657g-page 497 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 498 ? 2011-2013 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011-2013 microchip technology inc. ds70657g-page 499 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 500 ? 2011-2013 microchip technology inc. 64-lead plastic thin quad flatpack (pt) ? 10x10x1 mm body, 2.00 mm footprint [tqfp] notes: 1. pin 1 visual index feature may vary, but must be located within the hatched area. 2. chamfers at corners are optional; size may vary. 3. dimensions d1 and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed 0.25 mm per side. 4. dimensioning and tolerancing per asme y14.5m. bsc: basic dimension. theoretically exact value shown without tolerances. ref: reference dimension, usually without tolerance, for information purposes only. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging units millimeters dimension limits min nom max number of leads n 64 lead pitch e 0.50 bsc overall height a C C 1.20 molded package thickness a2 0.95 1.00 1.05 standoff a1 0.05 C 0.15 foot length l 0.45 0.60 0.75 footprint l1 1.00 ref foot angle 0 3.5 7 overall width e 12.00 bsc overall length d 12.00 bsc molded package width e1 10.00 bsc molded package length d1 10.00 bsc lead thickness c 0.09 C 0.20 lead width b 0.17 0.22 0.27 mold draft angle top 11 12 13 mold draft angle bottom 11 12 13 d d1 e e1 e b n note 1 123 note 2 c l a1 l1 a2 a microchip technology drawing c04-085b
? 2011-2013 microchip technology inc. ds70657g-page 501 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 502 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 503 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x appendix a: revision history revision a (april 2011) this is the initial released version of the document. revision b (july 2011) this revision includes minor typographical and formatting changes throughout the data sheet text. all other major changes are referenced by their respective section in tab le a - 1 . table a-1: major section updates section name update description ?high-performance, 16-bit digital signal controllers and microcontrollers? changed all pin diagrams references of vlap to tla. section 4.0 ?memory organization? updated the all resets values for clkdiv and pllfbd in the system control register map (see table 4-35). section 5.0 ?flash program memory? updated ?one word? to ?two words? in the first paragraph of section 5.2 ?rtsp operation? . section 9.0 ?oscillator configuration? updated the pll block diagram (see figure 9-2). updated the oscillator mode, fast rc oscillator (frc) with divide-by-n and pll (frcpll), by changing (frcdivn + pll) to (frcpll). changed (frcdivn + pll) to (frcpll) for cosc<2:0> = 001 and nosc<2:0> = 001 in the oscillator control register (see register 9-1). changed the por value from 0 to 1 for the doze<1:0> bits, from 1 to 0 for the frcdiv<0> bit, and from 0 to 1 for the pllpost<0> bit; updated the default definitions for the doze<2:0> and frcdiv<2:0> bits and updated all bit definitions for the pllpost<1:0> bits in the clock divisor register (see register 9-2). changed the por value from 0 to 1 for the plldiv<5:4> bits and updated the default definitions for all plldiv<8:0> bits in the pll feedback division register (see register 9-2). section 22.0 ?charge time measurement unit (ctmu)? updated the bit definitions for the irng<1:0> bits in the ctmu current control register (see register 22-3). section 25.0 ?op amp/ comparator module? updated the voltage reference block diagrams (see figure 25-1 and figure 25-2).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 504 ? 2011-2013 microchip technology inc. section 30.0 ?electrical characteristics? removed voltage on v cap with respect to vss and added note 5 in absolute maximum ratings (1) . removed parameter dc18 (v core ) and note 3 from the dc temperature and voltage specifications (see table 30-4). updated note 1 in the dc characteristics: operating current (i dd ) (see table 30-6). updated note 1 in the dc characteristics: idle current (i idle ) (see table 30-7). changed the typical values for parameters dc60a-dc60d and updated note 1 in the dc characteristics: power-down current (i pd ) (see table 30-8). updated note 1 in the dc characteristics: doze current (i doze ) (see table 30-9). updated note 2 in the electrical characteristics: bor (see table 30-12). updated parameters cm20 and cm31, and added parameters cm44 and cm45 in the ac/dc characteristics: op amp/comparator (see table 30-14). added the op amp/comparator reference voltage settling time specifications (see table 30-15). added op amp/comparator voltage reference dc specifications (see table 30-16). updated internal frc accuracy parameter f20a (see table 30-21). updated the typical value and units for parameter ctmui1, and added parameters ctmui4, ctmufv1, and ctmufv2 to the ctmu current source specifications (see table 30-55). section 31.0 ?packaging information? updated packages by replacing references of vlap with tla. ?product identification system? changed vlap to tla. table a-1: major section updates (continued) section name update description
? 2011-2013 microchip technology inc. ds70657g-page 505 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x revision c (december 2011) this revision includes typographical and formatting changes throughout the data sheet text. in addition, where applicable, new sections were added to each peripheral chapter that provide information and links to related resources, as well as helpful tips. for examples, see section 20.1 ?uart helpful tips? and section 3.6 ?cpu resources? . all occurrences of tla were updated to vtla throughout the document, with the exception of the pin diagrams (updated diagrams were not available at time of publication). a new chapter, section 31.0 ?dc and ac device characteristics graphs? , was added. all other major changes are referenced by their respective section in tab l e a - 2 . table a-2: major section updates section name update description ?16-bit microcontrollers and digital signal controllers (up to 256 kb flash and 32 kb sram) with high-speed pwm, op amps, and advanced analog? the content on the first page of this section was extensively reworked to provide the reader with the key features and functionality of this device family in an ?at-a-glance? format. section 1.0 ?device overview? updated the dspic33epxxxgp50x, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x block diagram (see figure 1-1), which now contains a cpu block and a reference to the cpu diagram. updated the description and note references in the pinout i/o descriptions for these pins: c1in2-, c2in2-, c3in2-, oa1out, oa2out, and oa3out (see table 1-1). section 2.0 ?guidelines for getting started with 16-bit digital signal controllers and microcontrollers? updated the recommended minimum connection diagram (see figure 2-1). section 3.0 ?cpu? updated the dspic33epxxxgp50x, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x cpu block diagram (see figure 3-1). updated the status register definition in the programmer?s model (see figure 3-2). section 4.0 ?memory organization? updated the data memory maps (see figure 4-6 and figure 4-11). removed the dcb<1:0> bits from the oc1con2, oc2con2, oc3con2, and oc4con2 registers in the output compare 1 through output compare 4 register map (see table 4-10). added the trig1 and trgcon1 registers to the pwm1 generator 1 register map (see table 4-13). added the trig2 and trgcon2 registers to the pwm1 generator 1 register map (see table 4-14). added the trig3 and trgcon3 registers to the pwm1 generator 1 register map (see table 4-15). updated the second note in section 4.7.1 ?bit-reversed addressing implementation? . section 8.0 ?direct memory access (dma)? updated the dma controller diagram (see figure 8-1). section 14.0 ?input capture? updated the bit values for the icx clock source of the ictsel<12:10> bits in the icxcon1 register (see register 14-1). section 15.0 ?output compare? updated the bit values for the ocx clock source of the octsel<2:0> bits in the ocxcon1 register (see register 15-1). removed the dcb<1:0> bits from the output compare x control register 2 (see register 15-2).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 506 ? 2011-2013 microchip technology inc. section 16.0 ?high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? updated the high-speed pwm module register interconnection diagram (see figure 16-2). added the trgconx and trigx registers (see register 16-12 and register 16-14, respectively). section 21.0 ?enhanced can (ecan?) module (dspic33epxxxgp/mc50x devices only)? updated the cancks bit value definitions in cictrl1: ecan control register 1 (see register 21-1). section 22.0 ?charge time measurement unit (ctmu)? updated the irng<1:0> bit value definitions and added note 2 in the ctmu current control register (see register 22-3). section 25.0 ?op amp/ comparator module? updated the op amp/comparator i/o operating modes diagram (see figure 25-1). updated the user-programmable blanking function block diagram (see figure 25-3). updated the digital filter interconnect block diagram (see figure 25-4). added section 25.1 ?op amp application considerations? . added note 2 to the comparator control register (see register 25-2). updated the bit definitions in the comparator mask gating control register (see register 25-5). section 27.0 ?special features? updated the ficd configuration register, updated note 1, and added note 3 in the configuration byte register map (see table 27-1). added section 27.2 ?user id words? . section 30.0 ?electrical characteristics? updated the following absolute maximum ratings: ? maximum current out of v ss pin ? maximum current into v dd pin added note 1 to the operating mips vs. voltage (see table 30-1). updated all idle current (i idle ) typical and maximum dc characteristics values (see table 30-7). updated all doze current (i doze ) typical and maximum dc characteristics values (see table 30-9). added note 2, removed parameter cm24, updated the typical values parameters cm10, cm20, cm21, cm32, cm41, cm44, and cm45, and updated the minimum values for cm40 and cm41, and the maximum value for cm40 in the ac/dc characteristics: op amp/comparator (see table 30-14). updated note 2 and the typical value for parameter vr310 in the op amp/ comparator reference voltage settling time specifications (see table 30-15). added note 1, removed parameter vrd312, and added parameter vrd314 to the op amp/comparator voltage reference dc specifications (see table 30-16). updated the minimum, typical, and maximum values for internal lprc accuracy (see table 30-22). updated the minimum, typical, and maximum values for parameter sy37 in the reset, watchdog timer, oscillator start-up timer, power-up timer timing requirements (see table 30-24). the maximum data rate values were updated for the spi2 maximum data/clock rate summary (see table 30-35) table a-2: major section updates (continued) section name update description
? 2011-2013 microchip technology inc. ds70657g-page 507 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x section 30.0 ?electrical characteristics? (continued) these spi2 timing requirements were updated: ? maximum value for parameter sp10 and the minimum clock period value for sckx in note 3 (see table 30-36, table 30-37, and table 30-38) ? maximum value for parameter sp70 and the minimum clock period value for sckx in note 3 (see table 30-40 and table 30-42) ? the maximum data rate values were updated for the spi2 maximum data/clock rate summary (see table 30-43) these spi1 timing requirements were updated: ? maximum value for parameters sp10 and the minimum clock period value for sckx in note 3 (see table 30-44, table 30-45, and table 30-46) ? maximum value for parameters sp70 and the minimum clock period value for sckx in note 3 (see table 30-47 through table 30-50) ? minimum value for parameters sp40 and sp41 see table 30-44 through table 30-50) updated all typical values for the ctmu current source specifications (see table 30-55). updated note1, the maximum value for parameter ad06, the minimum value for ad07, and the typical values for ad09 in the adc module specifications (see table 30-56). added note 1 to the adc module specifications (12-bit mode) (see table 30-57). added note 1 to the adc module specifications (10-bit mode) (see table 30-58). updated the minimum and maximum values for parameter ad21b in the 10-bit mode adc module specifications (see table 30-58). updated note 2 in the adc conversion (12-bit mode) timing requirements (see table 30-59). updated note 1 in the adc conversion (10-bit mode) timing requirements (see table 30-60). table a-2: major section updates (continued) section name update description
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 508 ? 2011-2013 microchip technology inc. revision d (december 2011) this revision includes typographical and formatting changes throughout the data sheet text. all other major changes are referenced by their respective section in tab le a - 3 . table a-3: major section updates section name update description ?16-bit microcontrollers and digital signal controllers (up to 512 kb flash and 48 kb sram) with high-speed pwm, op amps, and advanced analog? removed the analog comparators column and updated the op amps/comparators column in table 1 and table 2. section 21.0 ?enhanced can (ecan?) module (dspic33epxxxgp/mc50x devices only)? updated the cancks bit value definitions in cictrl1: ecan control register 1 (see register 21-1). section 30.0 ?electrical characteristics? updated the v bor specifications and/or its related note in the following electrical characteristics tables: ?table30-1 ?table30-4 ?table30-12 ?table30-14 ?table30-15 ?table30-16 ?table30-56 ?table30-57 ?table30-58 ?table30-59 ?table30-60
? 2011-2013 microchip technology inc. ds70657g-page 509 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x revision e (april 2012) this revision includes typographical and formatting changes throughout the data sheet text. all other major changes are referenced by their respective section in tab le a - 3 . table a-4: major section updates section name update description ?16-bit microcontrollers and digital signal controllers (up to 512 kb flash and 48 kb sram) with high-speed pwm, op amps, and advanced analog? the following 512 kb devices were added to the general purpose families table (see tab l e 1 ) : ? pic24ep512gp202 ? pic24ep512gp204 ? pic24ep512gp206 ? dspic33ep512gp502 ? dspic33ep512gp504 ? dspic33ep512gp506 the following 512 kb devices were added to the motor control families table (see tab l e 2 ) : ? pic24ep512mc202 ? pic24ep512mc204 ? pic24ep512mc206 ? dspic33ep512mc202 ? dspic33ep512mc204 ? dspic33ep512mc206 ? dspic33ep512mc502 ? dspic33ep512mc504 ? dspic33ep512mc506 certain pin diagrams were updated to include the new 512 kb devices. section 4.0 ?memory organization? added a program memory map for the new 512 kb devices (see figure 4-4). added a data memory map for the new dspic 512 kb devices (see figure 4-11). added a data memory map for the new pic24 512 kb devices (see figure 4-16). section 7.0 ?interrupt controller? updated the vecnum bits in the inttreg register (see register 7-7). section 11.0 ?i/o ports? added tip 6 to section 11.5 ?i/o helpful tips? . section 27.0 ?special features? the following modifications were made to the configuration byte register map (see table 27-1): ? added the column device memory size (kb) ? removed notes 1 through 4 ? added addresses for the new 512 kb devices section 30.0 ?electrical characteristics? updated the minimum value for parameter dc10 (see table 30-4). added power-down current (ipd) parameters for the new 512 kb devices (see table 30-8). updated the minimum value for parameter cm34 (see table 30-53 ). updated the minimum and maximum values and the conditions for paramteer sy12 (see table 30-22).
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 510 ? 2011-2013 microchip technology inc. revision f (november 2012) removed ?preliminary? from data sheet footer. revision g (march 2013) this revision includes the following global changes: ? changes ?fltx ? pin function to ?fltx? on all occurrences ? adds section 31.0 ?high-temperature electrical characteristics? for high-temperature (+150c) data this revision also includes minor typographical and formatting changes throughout the text. other major changes are referenced by their respective section in table a-5 . table a-5: major section updates section name update description cover section ? changes internal oscillator specification to 1.0% ? changes i/o sink/source values to 12 ma or 6 ma ? corrects 44-pin vtla pin diagram (pin 32 now shows as 5v tolerant) section 4.0 ?memory organization? ? deletes references to configuration shadow registers ? corrects the spelling of the jtagip and ptgwdtip bits throughout ? corrects the reset value of all iocon registers as c000h ? adds footnote to ta b l e 4 - 4 2 to indicate the absence of comparator 3 in 28-pin devices section 6.0 ?resets? ? removes references to cold and warm resets, and clarifies the initial configuration of the device clock source on all resets section 7.0 ?interrupt controller? ? corrects the definition of gie as ?global interrupt enable? (not ?general?) section 9.0 ?oscillator configuration? ? clarifies the behavior of the cf bit when cleared in software ? removes por behavior footnotes from all control registers ? corrects the tuning range of the tun<5:0> bits in register 9-4 to an overall range 1.5% section 13.0 ?timer2/3 and timer4/5? ? clarifies the presence of the adc trigger in 16-bit timer3 and timer5, as well as the 32-bit timers section 15.0 ?output compare? ? corrects the first trigger source for syncsel<4:0> (ocxcon2<4:0>) as ocxrs match section 16.0 ?high-speed pwm module? ? clarifies the source of the pwm interrupts in figure 16-1 ? corrects the reset states of ioconx<15:14> in register 16-13 as ? 11 ? section 17.0 ?quadrature encoder interface (qei) module? ? clarifies the operation of the imv<1:0> bits (qeicon<9:8>) with updated text and additional notes ? corrects the first prescaler value for qfvdiv<2:0> (qei1oc<13:11>), now 1:128 section 23.0 ?10-bit/12-bit analog-to-digital converter (adc)? ? adds note to figure 23-1 that op amp 3 is not available in 28-pin devices ? changes ?sample clock? to ?sample trigger? in ad1con1 ( register 23-1 ) ? clarifies footnotes on op amp usage in registers 23-5 and 23-6 section 25.0 ?op amp/ comparator module? ? adds note text to indicate that comparator 3 is unavailable in 28-pin devices ? splits figure 25-1 into two figures for clearer presentation ( figure 25-1 for op amp/ comparators 1 through 3, figure 25-2 for comparator 4). subsequent figures are renumbered accordingly. ? corrects reference description in xxxxx (now (av dd +av ss )/2) ? changes cmstat<15> in register 25-1 to ?psidl? section 27.0 ?special features? ? corrects the addresses of all configuration bytes for 512 kbyte devices
? 2011-2013 microchip technology inc. ds70657g-page 511 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x section 30.0 ?electrical characteristics? ? throughout: qualifies all footnotes relating to the operation of analog modules below v ddmin (replaces ?will have? with ?may have?) ? throughout: changes all references of spi timing parameter symbol ?tscp? to ?fscp? ? table 30-1 : changes v dd range to 3.0v to 3.6v ? table 30-4 : removes parameter dc12 (ram retention voltage) ? table 30-7 : updates maximum values at 10 and 20 mips ? table 30-8 : adds maximum i pd values, and removes all ? i wdt entries ? adds new ta b l e 3 0 - 9 (watchdog timer delta current) with consolidated values removed from ta b l e 3 0 - 8 . all subsequent tabes are renumbered accordingly. ? table 30-10 : adds footnote for all parameters for 1:2 doze ratio ? table 30-11 : - changes minimum and maximum values for d120 and d130 - adds minimum and maximum values for d131 - adds minimum and maximum values for d150 through d156, and removes typical values ? table 30-12 : - reformats table for readability - changes i ol conditions for do10 ? table 30-14 : adds footnote to d135 ? table 30-17 : changes minimum and maximum values for os30 ? table 30-19 : - splits temperature range and adds new values for f20a - reduces temperature range for f20b to extended temperatures only ? table 30-20 : - splits temperature range and adds new values for f21a - reduces temperature range for f20b to extended temperatures only ? table 30-53 : - adds maximum value to cm30 - adds footnote (?parameter characterized...?) to multiple parameters ? table 30-55 : adds minimum and maximum values for all ctmui specifications, and removes typical values ? table 30-57 : adds new footnote to ad09 ? table 30-58 : - removes all specifications for accuracy with external voltage references - removes typical values for ad23a and ad24a - replaces minimum and maximum values for ad21a, ad22a, ad23a and ad24a with new values, split by industrial and extended temperatures - removes maximum value of ad30 - removes minimum values from ad31a and ad32a - adds or changes typical values for ad30, ad31a, ad32a and ad33a ? table 30-59 : - removes all specifications for accuracy with external voltage references - removes maximum value of ad30 - removes typical values for ad23b and ad24b - replaces minimum and maximum values for ad21b, ad22b, ad23b and ad24b with new values, split by industrial and extended temperatures - removes minimum and maximum values from ad31b, ad32b, ad33b and ad34b - adds or changes typical values for ad30, ad31a, ad32a and ad33a ? table 30-61 : adds footnote to ad51 section 32.0 ?dc and ac device characteristics graphs? ? updates figure 32-8 (typical i dd @ 3.3v) with individual current vs. processor speed curves for the different program memory sizes section 33.0 ?packaging information? ? replaces drawing c04-149c (64-pin qfn, 7.15 x 7.15 exposed pad) with c04-154a (64-pin qfn, 5.4 x 5.4 exposed pad) table a-5: major section updates (continued) section name update description
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 512 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 513 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x index a absolute maximum ratings .............................................. 399 ac characteristics .................................................... 411, 469 adc module.............................................................. 457 adc module (10-bit mode)............................... 459, 471 adc module (12-bit mode)............................... 458, 471 capacitive loading requirements on output pins ....................................................... 411 internal frc accuracy.............................................. 413 internal lprc accuracy............................................ 413 load conditions ................................................ 411, 469 op amp/comparator voltage reference settling time specifications.............................. 455 spi1 maximum data/clock rate summary .............. 436 spi2 maximum data clock rate summary .............. 424 adc control registers ...................................................... 323 helpful tips ............................................................... 322 key features............................................................. 319 resources................................................................. 322 arithmetic logic unit (alu)................................................. 42 assembler mpasm assembler................................................... 396 b bit-reversed addressing .................................................. 113 example .................................................................... 114 implementation ......................................................... 113 sequence table (16-entry)....................................... 114 block diagrams 16-bit timer1 module................................................ 201 adc conversion clock period.................................. 321 adc with connection options for anx pins and op amps .................................................... 320 arbiter architecture ................................................... 108 comparator (module 4)............................................. 354 connections for on-chip voltage regulator............. 382 cpu core.................................................................... 34 crc module ............................................................. 371 crc shift engine...................................................... 372 ctmu module........................................................... 314 digital filter interconnect .......................................... 355 dma controller ......................................................... 139 dma module ............................................................. 137 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x............................. 23 ecan module ........................................................... 286 high-speed pwmx architectural overview .............. 225 high-speed pwmx register interconnection ........... 226 i2cx module.............................................................. 272 input capture x ......................................................... 211 multiplexing remappable output for rpn................. 178 op amp configuration a ........................................... 356 op amp configuration b ........................................... 357 op amp/comparator (modules 1, 2, 3)..................... 353 op amp/comparator voltage reference module ..... 354 oscillator system ...................................................... 151 output compare x module........................................ 217 pll............................................................................ 152 ptg module.............................................................. 336 quadrature encoder interface .................................. 248 remappable input for u1rx..................................... 174 reset system............................................................ 121 shared port structure............................................... 171 spix module ............................................................. 264 type b timer (timer2 and timer4) .......................... 206 type b/type c timer pair (32-bit timer) ................. 207 type c timer (timer3 and timer5) .......................... 206 uartx module ......................................................... 279 user-programmable blanking function.................... 355 watchdog timer (wdt)............................................ 383 brown-out reset (bor).................................................... 382 c c compilers mplab c18.............................................................. 396 charge time measurement unit. see ctmu. code examples ic1 connection to qei1 input on pin 43 of dspic33epxxxmc206 ................................ 174 port write/read ........................................................ 172 pwmx write-protected register unlock sequence ............................................. 224 pwrsav instruction syntax .................................... 161 code protection ........................................................ 377, 384 codeguard security ................................................. 377, 384 configuration bits ............................................................. 377 description................................................................ 379 configuration byte register map...................................... 378 configuring analog and digital port pins.......................... 172 cpu clocking system options ......................................... 152 fast rc (frc) oscillator.................................. 152 frc oscillator with pll ................................... 152 frc oscillator with postscaler ......................... 152 low-power rc (lprc) oscillator .................... 152 primary (xt, hs, ec) oscillator ....................... 152 primary oscillator with pll .............................. 152 control register.......................................................... 38 control registers........................................................ 38 resources .................................................................. 37 ctmu control registers...................................................... 315 resources ................................................................ 314 customer change notification service............................. 520 customer notification service .......................................... 520 customer support............................................................. 520 d data address space........................................................... 49 memory map for dspic33ep128mc20x/50x, dspic33ep128gp50x devices.......................... 52 memory map for dspic33ep256mc20x/50x, dspic33ep256gp50x devices.......................... 53 memory map for dspic33ep32mc20x/50x, dspic33ep32gp50x devices............................ 50 memory map for dspic33ep512mc20x/50x, dspic33ep512gp50x devices.......................... 54 memory map for dspic33ep64mc20x/50x, dspic33ep64gp50x devices............................ 51 memory map for pic24ep128gp/mc20x/50x devices............................................................... 57 memory map for pic24ep256gp/mc20x/50x devices............................................................... 58 memory map for pic24ep32gp/mc20x/50x devices............................................................... 55
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 514 ? 2011-2013 microchip technology inc. memory map for pic24ep512gp/mc20x/50x devices ............................................................... 59 memory map for pic24ep64gp/mc20x/50x devices ............................................................... 56 near data space ........................................................ 49 organization, alignment.............................................. 49 sfr space.................................................................. 49 width ........................................................................... 49 data memory arbitration and bus master priority ........................... 108 data space extended x ............................................................... 107 paged memory scheme ........................................... 103 dc and ac characteristics graphs and tables ................................................... 473 dc characteristics bor .......................................................................... 409 doze current (i doze ) ........................................ 405, 467 high temperature ..................................................... 466 i/o pin input specifications ....................................... 406 i/o pin output specifications ............................ 409, 468 idle current (i idle ) .................................................... 403 operating current (i dd )..................................... 402, 467 operating mips vs. voltage.............................. 400, 466 power-down current (i pd ) ................................ 404, 467 program memory ...................................................... 410 temperature and voltage ......................................... 466 temperature and voltage specifications .................. 401 thermal operating conditions .................................. 466 watchdog timer delta current ................................. 405 development support ....................................................... 395 dma controller channel to peripheral associations .......................... 138 control registers ...................................................... 139 dmaxcnt......................................................... 139 dmaxcon ........................................................ 139 dmaxpad......................................................... 139 dmaxreq ........................................................ 139 dmaxsta ......................................................... 139 dmaxstb ......................................................... 139 resources................................................................. 139 supported peripherals .............................................. 137 doze mode........................................................................ 163 dsp engine......................................................................... 42 e ecan message buffers word 0 ...................................................................... 308 word 1 ...................................................................... 308 word 2 ...................................................................... 309 word 3 ...................................................................... 309 word 4 ...................................................................... 310 word 5 ...................................................................... 310 word 6 ...................................................................... 311 word 7 ...................................................................... 311 ecan module control registers ...................................................... 288 modes of operation .................................................. 287 overview ................................................................... 285 resources................................................................. 287 electrical characteristics................................................... 399 ac ..................................................................... 411, 469 enhanced can module .................................................... 285 equations device operating frequency .................................... 152 f osc calculation ...................................................... 152 f vco calculation ...................................................... 152 errata .................................................................................. 20 f filter capacitor (c efc ) specifications .............................. 401 flash program memory .................................................... 117 control registers ...................................................... 118 operations ................................................................ 118 programming algorithm ............................................ 120 resources ................................................................ 118 rtsp operation ....................................................... 118 table instructions ..................................................... 117 flexible configuration ....................................................... 377 h high-speed pwm ............................................................. 223 control registers ...................................................... 228 faults ........................................................................ 223 resources ................................................................ 227 high-temperature electrical characteristics .................... 465 absolute maximum ratings ...................................... 465 i i/o ports............................................................................ 171 helpful tips............................................................... 179 parallel i/o (pio) ...................................................... 171 resources ................................................................ 180 write/read timing .................................................... 172 in-circuit debugger........................................................... 384 in-circuit emulation .......................................................... 377 in-circuit serial programming (icsp)....................... 377, 384 input capture .................................................................... 211 control registers ...................................................... 213 resources ................................................................ 212 input change notification (icn)........................................ 172 instruction addressing modes .......................................... 110 file register instructions .......................................... 110 fundamental modes supported ............................... 110 mac instructions ...................................................... 111 mcu instructions ...................................................... 110 move and accumulator instructions.......................... 111 other instructions ..................................................... 111 instruction set summary overview........................................................... 388 instruction set summary .................................................. 385 symbols used in opcode descriptions .................... 386 inter-integrated circuit (i 2 c) ............................................. 271 control registers ...................................................... 274 resources ................................................................ 273 internal rc oscillator use with wdt........................................................... 383 internet address ............................................................... 520
? 2011-2013 microchip technology inc. ds70657g-page 515 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x interrupt controller control and status registers .................................... 129 intcon1 .......................................................... 129 intcon2 .......................................................... 129 intcon3 .......................................................... 129 intcon4 .......................................................... 129 inttreg .......................................................... 129 interrupt vector details ............................................. 127 interrupt vector table (ivt) ...................................... 125 reset sequence ....................................................... 125 resources................................................................. 129 j jtag boundary scan interface ........................................ 377 jtag interface .................................................................. 384 m memory maps extended data space ............................................... 107 memory organization.......................................................... 43 resources................................................................... 60 microchip internet web site .............................................. 520 modulo addressing ........................................................... 112 applicability ............................................................... 113 operation example ................................................... 112 start and end address.............................................. 112 w address register selection .................................. 112 mplab asm30 assembler, linker, librarian ................... 396 mplab integrated development environment software............................................... 395 mplab pm3 device programmer .................................... 398 mplab real ice in-circuit emulator system................. 397 mplink object linker/mplib object librarian ................ 396 o op amp application considerations ....................................... 356 configuration a ................................................. 356 configuration b ................................................. 357 op amp/comparator ......................................................... 353 control registers ...................................................... 358 resources................................................................. 357 open-drain configuration ................................................. 172 oscillator control registers ...................................................... 154 resources................................................................. 153 output compare ............................................................... 217 control registers ...................................................... 219 resources................................................................. 218 p packaging ......................................................................... 477 details ....................................................................... 500 marking ............................................................. 477, 479 peripheral module disable (pmd) .................................... 163 peripheral pin select (pps) .............................................. 173 available peripherals ................................................ 173 available pins ........................................................... 173 control ...................................................................... 173 control registers ...................................................... 181 input mapping ........................................................... 174 output selection for remappable pins..................... 178 pin selection for selectable input sources............... 176 selectable input sources .......................................... 175 peripheral trigger generator (ptg) module .................... 335 pinout i/o descriptions (table) ............................................ 24 power-saving features .................................................... 161 clock frequency....................................................... 161 clock switching ........................................................ 161 instruction-based modes.......................................... 161 idle.................................................................... 162 interrupts coincident with power save instructions ............................................... 162 sleep ................................................................ 162 resources ................................................................ 163 program address space..................................................... 43 construction ............................................................. 115 data access from program memory using table instructions ............................................. 116 data access from, address generation ................... 115 memory map (dspic33ep128gp50x, dspic33ep128mc20x/50x, pic24ep128gp/mc20x devices).......................... 45 memory map (dspic33ep256gp50x, dspic33ep256mc20x/50x, pic24ep256gp/mc20x devices).......................... 46 memory map (dspic33ep32gp50x, dspic33ep32mc20x/50x, pic24ep32gp/mc20x devices)............................ 43 memory map (dspic33ep512gp50x, dspic33ep512mc20x/50x, pic24ep512gp/mc20x devices).......................... 47 memory map (dspic33ep64gp50x, dspic33ep64mc20x/50x, pic24ep64gp/mc20x devices)............................ 44 table read high instructions tblrdh ........................................................... 116 table read low instructions (tblrdl) ................... 116 program memory organization ............................................................... 48 reset vector............................................................... 48 programmable crc generator ........................................ 371 control registers...................................................... 373 overview................................................................... 372 resources ................................................................ 372 programmer?s model .......................................................... 35 register description ................................................... 35 ptg control registers...................................................... 338 introduction............................................................... 335 output descriptions .................................................. 351 resources ................................................................ 337 step commands and format ................................... 348 q qei control registers...................................................... 250 resources ................................................................ 249 quadrature encoder interface (qei)................................. 247 r reader response............................................................. 521 register maps adc1 .......................................................................... 82 cpu core (dspic33epxxxmc20x/50x, dspic33epxxxgp50x devices) ....................... 61 cpu core (pic24epxxxgp/mc20x devices).......... 63 crc............................................................................ 86 ctmu ......................................................................... 95 dmac ......................................................................... 96
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 516 ? 2011-2013 microchip technology inc. ecan1 (when win (c1ctrl) = 0 or 1) for dspic33epxxxmc/gp50x devices ............. 83 ecan1 (when win (c1ctrl) = 0) for dspic33epxxxmc/gp50x devices ............. 83 ecan1 (win (c1ctrl) = 1) for dspic33epxxxmc/gp50x devices .................. 84 i2c1 and i2c2 ............................................................. 80 input capture 1 through input capture 4 .................... 74 interrupt controller (dspic33epxxxgp50x devices) ...................... 67 interrupt controller (dspic33epxxxmc20x devices) ...................... 69 interrupt controller (dspic33epxxxmc50x devices) ...................... 71 interrupt controller (pic24epxxxgp20x devices) .......................... 64 interrupt controller (pic24epxxxmc20x devices).......................... 65 jtag interface ............................................................ 95 nvm ............................................................................ 91 op amp/comparator ................................................... 95 output compare 1 through output compare 4........... 75 peripheral pin select input (dspic33epxxxgp50x devices) ...................... 89 peripheral pin select input (dspic33epxxxmc20x devices) ...................... 90 peripheral pin select input (dspic33epxxxmc50x devices) ...................... 89 peripheral pin select input (pic24epxxxgp20x devices) .......................... 88 peripheral pin select input (pic24epxxxmc20x devices).......................... 88 peripheral pin select output (dspic33epxxxgp/mc202/502, pic24epxxxgp/mc202 devices) ..................... 86 peripheral pin select output (dspic33epxxxgp/mc203/503, pic24epxxxgp/mc203 devices) ..................... 86 peripheral pin select output (dspic33epxxxgp/mc204/504, pic24epxxxgp/mc204 devices) ..................... 87 peripheral pin select output (dspic33epxxxgp/mc206/506, pic24epxxgp/mc206 devices)........................ 87 pmd (dspic33epxxxgp50x devices) ..................... 93 pmd (dspic33epxxxmc20x devices) ..................... 94 pmd (dspic33epxxxmc50x devices) ..................... 93 pmd (pic24epxxxgp20x devices) ......................... 92 pmd (pic24epxxxmc20x devices)......................... 92 porta (pic24epxxxgp/mc202, dspic33epxxxgp/mc202/502 devices) ........ 102 porta (pic24epxxxgp/mc203, dspic33epxxxgp/mc203/503 devices) ........ 101 porta (pic24epxxxgp/mc204, dspic33epxxxgp/mc204/504 devices) ........ 100 porta (pic24epxxxgp/mc206, dspic33epxxxgp/mc206/506 devices) .......... 97 portb (pic24epxxxgp/mc202, dspic33epxxxgp/mc202/502 devices) ........ 102 portb (pic24epxxxgp/mc203, dspic33epxxxgp/mc203/503 devices) ........ 101 portb (pic24epxxxgp/mc204, dspic33epxxxgp/mc204/504 devices) ........ 100 portb (pic24epxxxgp/mc206, dspic33epxxxgp/mc206/506 devices) .......... 97 portc (pic23epxxxgp/mc203, dspic33epxxxgp/mc203/503 devices) ........ 101 portc (pic24epxxxgp/mc204, dspic33epxxxgp/mc204/504 devices) ........ 100 portc (pic24epxxxgp/mc206, dspic33epxxxgp/mc206/506 devices) .......... 97 portd (pic24epxxxgp/mc206, dspic33epxxxgp/mc206/506 devices) .......... 98 porte (pic24epxxxgp/mc206, dspic33epxxxgp/mc206/506 devices) .......... 98 portf (pic24epxxxgp/mc206, dspic33epxxxgp/mc206/506 devices) .......... 98 portg (pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices) .......... 99 ptg ............................................................................ 76 pwm (dspic33epxxxmc20x/50x, pic24epxxxmc20x devices)........................... 77 pwm generator 1 (dspic33epxxxmc20x/50x, pic24epxxxmc20x devices)........................... 77 pwm generator 2 (dspic33epxxxmc20x/50x, pic24epxxxmc20x devices)........................... 78 pwm generator 3 (dspic33epxxxmc20x/50x, pic24epxxxmc20x devices)........................... 78 qei1 (dspic33epxxxmc20x/50x, pic24epxxxmc20x devices)........................... 79 reference clock ......................................................... 91 spi1 and spi2 ............................................................ 81 system control ........................................................... 91 timer1 through timer5 ............................................... 73 uart1 and uart2 .................................................... 80 registers ad1chs0 (adc1 input channel 0 select)............... 331 ad1chs123 (adc1 input channel 1, 2, 3 select)... 329 ad1con1 (adc1 control 1) .................................... 323 ad1con2 (adc1 control 2) .................................... 325 ad1con3 (adc1 control 3) .................................... 327 ad1con4 (adc1 control 4) .................................... 328 ad1cssh (adc1 input scan select high) .............. 333 ad1cssl (adc1 input scan select low)................ 334 altdtrx (pwmx alternate dead-time).................. 236 auxconx (pwmx auxiliary control) ....................... 245 chop (pwmx chop clock generator)..................... 232 clkdiv (clock divisor) ............................................ 156 cm4con (comparator 4 control) ............................ 362 cmstat (op amp/comparator status) ................... 358 cmxcon (comparator x control, x = 1,2,3)............. 360 cmxfltr (comparator x filter control)................... 368 cmxmskcon (comparator x mask gating control) ................................................. 366 cmxmsksrc (comparator x mask source select control) ..................................... 364 corcon (core control) .................................... 40, 131 crccon1 (crc control 1) ..................................... 373 crccon2 (crc control 2) ..................................... 374 crcxorh (crc xor polynomial high)................. 375 crcxorl (crc xor polynomial low) .................. 375 ctmucon1 (ctmu control 1) ................................ 315 ctmucon2 (ctmu control 2) ................................ 316 ctmuicon (ctmu current control) ....................... 317 cvrcon (comparator voltage reference control) ........................................... 369 cxbufpnt1 (ecanx filter 0-3 buffer pointer 1)..... 298 cxbufpnt2 (ecanx filter 4-7 buffer pointer 2)..... 299 cxbufpnt3 (ecanx filter 8-11 buffer pointer 3)... 299
? 2011-2013 microchip technology inc. ds70657g-page 517 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x cxbufpnt4 (ecanx filter 12-15 buffer pointer 4)................................................ 300 cxcfg1 (ecanx baud rate configuration 1) ......... 296 cxcfg2 (ecanx baud rate configuration 2) ......... 297 cxctrl1 (ecanx control 1) ................................... 288 cxctrl2 (ecanx control 2) ................................... 289 cxec (ecanx transmit/receive error count)......... 296 cxfctrl (ecanx fifo control) ............................. 291 cxfen1 (ecanx acceptance filter enable 1) ......... 298 cxfifo (ecanx fifo status).................................. 292 cxfmsksel1 (ecanx filter 7-0 mask selection) ................................................ 302 cxfmsksel2 (ecanx filter 15-8 mask selection) ................................................ 303 cxinte (ecanx interrupt enable)............................ 295 cxintf (ecanx interrupt flag) ................................ 293 cxrxfneid (ecanx acceptance filter n extended identifier)........................................... 302 cxrxfnsid (ecanx acceptance filter n standard identifier) ........................................... 301 cxrxful1 (ecanx receive buffer full 1) .............. 305 cxrxful2 (ecanx receive buffer full 2) .............. 305 cxrxmneid (ecanx acceptance filter mask n extended identifier)........................................... 304 cxrxmnsid (ecanx acceptance filter mask n standard identifier) ........................................... 304 cxrxovf1 (ecanx receive buffer overflow 1) ..... 306 cxrxovf2 (ecanx receive buffer overflow 2) ..... 306 cxtrmncon (ecanx tx/rx buffer mn control).... 307 cxvec (ecanx interrupt code) ............................... 290 devid (device id) .................................................... 381 devrev (device revision) ...................................... 381 dmalca (dma last channel active status) ........... 148 dmapps (dma ping-pong status) .......................... 149 dmapwc (dma peripheral write collision status)................................................ 146 dmarqc (dma request collision status) .............. 147 dmaxcnt (dma channel x transfer count) ........... 144 dmaxcon (dma channel x control) ....................... 140 dmaxpad (dma channel x peripheral address)..... 144 dmaxreq (dma channel x irq select) ................. 141 dmaxstah (dma channel x start address a, high) ...................................... 142 dmaxstal (dma channel x start address a, low)....................................... 142 dmaxstbh (dma channel x start address b, high) ...................................... 143 dmaxstbl (dma channel x start address b, low) ............................................... 143 dsadrh (dma most recent ram high address) ................................................... 145 dsadrl (dma most recent ram low address) .... 145 dtrx (pwmx dead-time) ........................................ 236 fclconx (pwmx fault current-limit control) ........ 241 i2cxcon (i2cx control) ........................................... 274 i2cxmsk (i2cx slave mode address mask) ............ 278 i2cxstat (i2cx status) ........................................... 276 icxcon1 (input capture x control 1) ....................... 213 icxcon2 (input capture x control 2) ....................... 214 indxxcnth (index counter high word).................. 257 indxxcntl (index counter low word) ................... 257 indxxhld (index counter hold) .............................. 258 intcon1 (interrupt control 1).................................. 132 intcon2 (interrupt control 2).................................. 134 intcon2 (interrupt control 3).................................. 135 intcon4 (interrupt control 4) ................................. 135 inttreg interrupt control and status register ...... 136 intxhldh (interval timer hold high word) ............ 261 intxhldl (interval timer hold low word).............. 261 intxtmrh (interval timer high word) .................... 260 intxtmrl (interval timer low word)...................... 261 ioconx (pwmx i/o control).................................... 238 lebconx (pwmx leading-edge blanking control) .............................................. 243 lebdlyx (pwmx leading-edge blanking delay).... 244 mdc (pwmx master duty cycle) ............................. 232 nvmadr (nonvolatile memory lower address)...... 120 nvmadru (nonvolatile memory upper address) ... 120 nvmcon (nonvolatile memory (nvm) control) ...... 119 nvmkey (nonvolatile memory key) ........................ 120 ocxcon1 (output compare x control 1) ................ 219 ocxcon2 (output compare x control 2) ................ 221 osccon (oscillator control)................................... 154 osctun (frc oscillator tuning)............................ 159 pdcx (pwmx generator duty cycle)....................... 235 phasex (pwmx primary phase-shift)..................... 235 pllfbd (pll feedback divisor) ............................. 158 pmd1 (peripheral module disable control 1) .......... 164 pmd2 (peripheral module disable control 2) .......... 166 pmd3 (peripheral module disable control 3) .......... 167 pmd4 (peripheral module disable control 4) .......... 167 pmd6 (peripheral module disable control 6) .......... 168 pmd7 (peripheral module disable control 7) .......... 169 posxcnth (position counter high word) .............. 256 posxcntl (position counter low word)................ 256 posxhld (position counter hold)........................... 256 ptcon (pwmx time base control) ........................ 228 ptcon2 (pwmx primary master clock divider select) .................................................. 230 ptgadj (ptg adjust).............................................. 346 ptgbte (ptg broadcast trigger enable)............... 341 ptgc0lim (ptg counter 0 limit) ........................... 344 ptgc1lim (ptg counter 1 limit) ........................... 345 ptgcon (ptg control)........................................... 340 ptgcst (ptg control/status) ................................ 338 ptghold (ptg hold) ............................................. 345 ptgl0 (ptg literal 0).............................................. 346 ptgqptr (ptg step queue pointer) ..................... 347 ptgquex (ptg step queue x)............................... 347 ptgsdlim (ptg step delay limit) ......................... 344 ptgt0lim (ptg timer0 limit) ................................ 343 ptgt1lim (ptg timer1 limit) ................................ 343 ptper (pwmx primary master time base period) .............................................................. 231 pwmconx (pwmx control) .................................... 233 qei1con (qei control) ........................................... 250 qei1gech (greater than or equal compare high word) ....................................................... 260 qei1gecl (greater than or equal compare low word) ........................................................ 260 qei1ich (initialization/capture high word) ............. 258 qei1icl (initialization/capture low word)............... 258 qei1ioc (qei i/o control) ....................................... 252 qei1lech (less than or equal compare high word) ....................................................... 259 qei1lecl (less than or equal compare low word) ........................................................ 259 qei1stat (qei status) ........................................... 254 rcon (reset control).............................................. 123 refocon (reference oscillator control) ............... 160
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 518 ? 2011-2013 microchip technology inc. rpinr0 (peripheral pin select input 0) .................... 181 rpinr1 (peripheral pin select input 1) .................... 182 rpinr11 (peripheral pin select input 11) ................ 185 rpinr12 (peripheral pin select input 12) ................ 186 rpinr14 (peripheral pin select input 14) ................ 187 rpinr15 (peripheral pin select input 15) ................ 188 rpinr18 (peripheral pin select input 18) ................ 189 rpinr19 (peripheral pin select input 19) ................ 189 rpinr22 (peripheral pin select input 22) ................ 190 rpinr23 (peripheral pin select input 23) ................ 191 rpinr26 (peripheral pin select input 26) ................ 191 rpinr3 (peripheral pin select input 3) .................... 182 rpinr37 (peripheral pin select input 37) ................ 192 rpinr38 (peripheral pin select input 38) ................ 193 rpinr39 (peripheral pin select input 39) ................ 194 rpinr7 (peripheral pin select input 7) .................... 183 rpinr8 (peripheral pin select input 8) .................... 184 rpor0 (peripheral pin select output 0) .................. 195 rpor1 (peripheral pin select output 1) .................. 195 rpor2 (peripheral pin select output 2) .................. 196 rpor3 (peripheral pin select output 3) .................. 196 rpor4 (peripheral pin select output 4) .................. 197 rpor5 (peripheral pin select output 5) .................. 197 rpor6 (peripheral pin select output 6) .................. 198 rpor7 (peripheral pin select output 7) .................. 198 rpor8 (peripheral pin select output 8) .................. 199 rpor9 (peripheral pin select output 9) .................. 199 sevtcmp (pwmx primary special event compare) .......................................................... 231 spixcon1 (spix control 1)...................................... 268 spixcon2 (spix control 2)...................................... 270 spixstat (spix status and control) ....................... 266 sr (cpu status) ............................................. 38, 130 t1con (timer1 control)........................................... 203 trgconx (pwmx trigger control).......................... 237 trigx (pwmx primary trigger compare value) ...... 240 txcon (timer2 and timer4 control)........................ 208 tycon (timer3 and timer5 control)........................ 209 uxmode (uartx mode) .......................................... 281 uxsta (uartx status and control) ......................... 283 velxcnt (velocity counter) .................................... 257 resets ............................................................................... 121 brown-out reset (bor) ............................................ 121 configuration mismatch reset (cm)......................... 121 illegal condition reset (iopuwr) ............................ 121 illegal opcode ................................................... 121 security ............................................................. 121 uninitialized w register.................................... 121 master clear (mclr ) pin reset ............................... 121 power-on reset (por) ............................................. 121 reset instruction (swr)......................................... 121 resources................................................................. 122 trap conflict reset (trapr).................................... 121 watchdog timer time-out reset (wdto)................ 121 resources required for digital pfc ............................. 30, 32 revision history ................................................................ 503 s serial peripheral interface (spi) ....................................... 263 software simulator (mplab sim)..................................... 397 software stack pointer, frame pointer call stack frame.................................................... 109 special features of the cpu............................................. 377 spi control registers ...................................................... 266 helpful tips............................................................... 265 resources ................................................................ 265 t temperature and voltage specifications ac..................................................................... 411, 469 thermal operating conditions.......................................... 400 thermal packaging characteristics .................................. 400 timer1............................................................................... 201 control register........................................................ 203 resources ................................................................ 202 timer2/3 and timer4/5 ..................................................... 205 control registers ...................................................... 208 resources ................................................................ 207 timing diagrams 10-bit adc conversion (chps<1:0> = 01, simsam = 0, asam = 0, ssrc<2:0> = 000, ssrcg = 0) .... 462 10-bit adc conversion (chps<1:0> = 01, simsam = 0, asam = 1, ssrc<2:0> = 111, ssrcg = 0, samc<4:0> = 00010)....................................... 462 12-bit adc conversion (asam = 0, ssrc<2:0> = 000, ssrcg = 0) ...................... 460 bor and master clear reset ................................... 414 ecan i/o .................................................................. 452 external clock........................................................... 412 high-speed pwmx fault .......................................... 420 high-speed pwmx module ...................................... 420 i/o characteristics .................................................... 414 i2cx bus data (master mode) .................................. 448 i2cx bus data (slave mode) .................................... 450 i2cx bus start/stop bits (master mode)................... 448 i2cx bus start/stop bits (slave mode)..................... 450 input capture x (icx) ................................................ 418 ocx/pwmx............................................................... 419 output compare x (ocx).......................................... 419 qea/qeb input ........................................................ 422 qei module index pulse ........................................... 423 spi1 master mode (full-duplex, cke = 0, ckp = x, smp = 1) ........................................... 439 spi1 master mode (full-duplex, cke = 1, ckp = x, smp = 1) ........................................... 438 spi1 master mode (half-duplex, transmit only, cke = 0) ........................................................... 436 spi1 master mode (half-duplex, transmit only, cke = 1) ........................................................... 437 spi1 slave mode (full-duplex, cke = 0, ckp = 0, smp = 0) ........................................... 446 spi1 slave mode (full-duplex, cke = 0, ckp = 1, smp = 0) ........................................... 444 spi1 slave mode (full-duplex, cke = 1, ckp = 0, smp = 0) ........................................... 440 spi1 slave mode (full-duplex, cke = 1, ckp = 1, smp = 0) ........................................... 442 spi2 master mode (full-duplex, cke = 0, ckp = x, smp = 1) ........................................... 427 spi2 master mode (full-duplex, cke = 1, ckp = x, smp = 1) ........................................... 426 spi2 master mode (half-duplex, transmit only, cke = 0) ........................................................... 424 spi2 master mode (half-duplex, transmit only, cke = 1) ........................................................... 425
? 2011-2013 microchip technology inc. ds70657g-page 519 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x spi2 slave mode (full-duplex, cke = 0, ckp = 0, smp = 0) ........................................... 434 spi2 slave mode (full-duplex, cke = 0, ckp = 1, smp = 0) ........................................... 432 spi2 slave mode (full-duplex, cke = 1, ckp = 0, smp = 0) ........................................... 428 spi2 slave mode (full-duplex, cke = 1, ckp = 1, smp = 0) ........................................... 430 timer1-timer5 external clock .................................. 416 timerq (qei module) external clock ....................... 421 uartx i/o................................................................. 452 timing requirements dma module ............................................................. 463 external clock........................................................... 412 i/o ............................................................................. 414 timing specifications 10-bit adc conversion requirements ..................... 463 12-bit adc conversion requirements ..................... 461 ctmu current source requirements....................... 456 ecanx i/o requirements ......................................... 452 high-speed pwmx requirements ............................ 420 i2cx bus data requirements (master mode) ........... 449 i2cx bus data requirements (slave mode) ............. 451 input capture x requirements .................................. 418 ocx/pwmx mode requirements.............................. 419 op amp/comparator requirements ......................... 453 op amp/comparator voltage reference requirements ................................................... 455 output compare x requirements ............................. 419 pll clock.......................................................... 413, 469 qei external clock requirements ............................ 421 qei index pulse requirements................................. 423 quadrature decoder requirements.......................... 422 reset, watchdog timer, oscillator start-up timer, power-up timer requirements ......................... 415 spi1 master mode (full-duplex, cke = 0, ckp = x, smp = 1) requirements .................... 439 spi1 master mode (full-duplex, cke = 1, ckp = x, smp = 1) requirements .................... 438 spi1 master mode (half-duplex, transmit only) requirements ................................................... 437 spi1 slave mode (full-duplex, cke = 0, ckp = 0, smp = 0) requirements.................... 447 spi1 slave mode (full-duplex, cke = 0, ckp = 1, smp = 0) requirements.................... 445 spi1 slave mode (full-duplex, cke = 1, ckp = 0, smp = 0) requirements.................... 441 spi1 slave mode (full-duplex, cke = 1, ckp = 1, smp = 0) requirements.................... 443 spi2 master mode (full-duplex, cke = 0, ckp = x, smp = 1) requirements.................... 427 spi2 master mode (full-duplex, cke = 1, ckp = x, smp = 1) requirements.................... 426 spi2 master mode (half-duplex, transmit only) requirements ................................................... 425 spi2 slave mode (full-duplex, cke = 0, ckp = 0, smp = 0) requirements.................... 435 spi2 slave mode (full-duplex, cke = 0, ckp = 1, smp = 0) requirements.................... 433 spi2 slave mode (full-duplex, cke = 1, ckp = 0, smp = 0) requirements.................... 429 spi2 slave mode (full-duplex, cke = 1, ckp = 1, smp = 0) requirements.................... 431 timer1 external clock requirements ....................... 416 timer2/timer4 external clock requirements........... 417 timer3/timer5 external clock requirements........... 417 uartx i/o requirements......................................... 452 u universal asynchronous receiver transmitter (uart) ... 279 control registers...................................................... 281 helpful tips............................................................... 279 resources ................................................................ 280 user id words .................................................................. 382 v voltage regulator (on-chip) ............................................ 382 w watchdog timer (wdt)............................................ 377, 383 programming considerations ................................... 383 www address ................................................................. 520 www, on-line support ....... .............................................. 20
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 520 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 521 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x the microchip web site microchip provides online support via our www site at www.microchip.com . this web site is used as a means to make files and information easily available to customers. accessible by using your favorite internet browser, the web site contains the following information: ? product support ? data sheets and errata, application notes and sample programs, design resources, user?s guides and hardware support documents, latest software releases and archived software ? general technical support ? frequently asked questions (faqs), technical support requests, online discussion groups, microchip consultant program member listing ? business of microchip ? product selector and ordering guides, latest microchip press releases, listing of seminars and events, listings of microchip sales offices, distributors and factory representatives customer change notification service microchip?s customer notification service helps keep customers current on microchip products. subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest. to register, access the microchip web site at www.microchip.com . under ?support?, click on ?customer change notification? and follow the registration instructions. customer support users of microchip products can receive assistance through several channels: ? distributor or representative ? local sales office ? field application engineer (fae) ? technical support customers should contact their distributor, representative or field application engineer (fae) for support. local sales offices are also available to help customers. a listing of sales offices and locations is included in the back of this document. technical support is available through the web site at: http://microchip.com/support
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 522 ? 2011-2013 microchip technology inc. reader response it is our intention to provide you with the best documentation possible to ensure successful use of your microchip product. if you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation can better serve you, please fax your comments to the technical publications manager at (480) 792-4150. please list the following information, and use this outline to provide us with your comments about this document. to: technical publications manager re: reader response total pages sent ________ from: name company address city / state / zip / country telephone: (_______) _________ - _________ application (optional): would you like a reply? y n device: literature number: questions: fax: (______) _________ - _________ ds70657g dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x 1. what are the best features of this document? 2. how does this document meet your hardware and software development needs? 3. do you find the organization of this document easy to follow? if not, why? 4. what additions to the document do you think would enhance the structure and subject? 5. what deletions from the document could be made without affecting the overall usefulness? 6. is there any incorrect or misleading information (what and where)? 7. how would you improve this document?
? 2011-2013 microchip technology inc. ds70657g-page 523 dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x product identification system to order or obtain information, e.g., on pricing or de livery, refer to the factory or the listed sales office . architecture: 33 = 16-bit digital signal controller 24 = 16-bit microcontroller flash memory family: ep = enhanced performance product group: gp = general purpose family mc = motor control family pin count: 02 = 28-pin 03 = 36-pin 04 = 44-pin 06 = 64-pin temperature range: i=-40 ? c to+85 ? c (industrial) e=-40 ? c to+125 ? c (extended) package: ml = plastic quad, no lead package - (44-pin) 8x8 mm body (qfn) mm = plastic quad, no lead package - (28-pin) 6x6 mm body (qfn-s) mr = plastic quad, no lead package - (64-pin) 9x9 mm body (qfn) pt = plastic thin quad flatpack - (44-pin) 10x10 mm body (tqfp) pt = plastic thin quad flatpack - (64-pin) 10x10 mm body (tqfp) so = plastic small outline, wide - (28-pin) 7.50 mil body (soic) sp = skinny plastic dual in-line - (28-pin) 300 mil body (spdip) ss = plastic shrink small outline - (28-pin) 5.30 mm body (ssop) tl = very thin leadless array - (36-pin) 5x5 mm body (vtla) tl = very thin leadless array - (44-pin) 6x6 mm body (vtla) examples: dspic33ep64mc504-i/pt: dspic33, enhanced performance, 64-kbyte program memory, motor control, 44-pin, industrial temperature, tqfp package. microchip trademark architecture flash memory family program memory size (kbyte) product group pin count temperature range package pattern dspic 33 ep 64 mc5 04 t i / p t - xxx tape and reel flag (if applicable)
dspic33epxxxgp50x, dspic33epxxxmc20x/50x and pic24epxxxgp/mc20x ds70657g-page 524 ? 2011-2013 microchip technology inc. notes:
? 2011-2013 microchip technology inc. ds70657g-page 525 information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. it is your responsibility to ensure that your application meets with your specifications. microchip makes no representations or warranties of any kind whether express or implied, written or oral, statutory or otherwise, related to the information, including but not limited to its condition, quality, performance, merchantability or fitness for purpose . microchip disclaims all liability arising from this information and its use. use of microchip devices in life support and/or safety applications is entirely at the buyer?s risk, and the buyer agrees to defend, indemnify and hold harmless microchip from any and all damages, claims, suits, or expenses resulting from such use. no licenses are conveyed, implicitly or otherwise, under any microchip intellectual property rights. trademarks the microchip name and logo, the microchip logo, dspic, flashflex, k ee l oq , k ee l oq logo, mplab, pic, picmicro, picstart, pic 32 logo, rfpic, sst, sst logo, superflash and uni/o are registered trademarks of microchip technology incorporated in the u.s.a. and other countries. filterlab, hampshire, hi-tech c, linear active thermistor, mtp, seeval and the embedded control solutions company are registered trademarks of microchip technology incorporated in the u.s.a. silicon storage technology is a registered trademark of microchip technology inc. in other countries. analog-for-the-digital age, app lication maestro, bodycom, chipkit, chipkit logo, codeguard, dspicdem, dspicdem.net, dspicworks, dsspeak, ecan, economonitor, fansense, hi-tide, in-circuit serial programming, icsp, mindi, miwi, mpasm, mpf, mplab certified logo, mplib, mplink, mtouch, omniscient code generation, picc, picc-18, picdem, picdem.net, pickit, pictail, real ice, rflab, select mode, sqi, serial quad i/o, total endurance, tsharc, uniwindriver, wiperlock, zena and z-scale are trademarks of microchip technology incorporated in the u.s.a. and other countries. sqtp is a service mark of microchip technology incorporated in the u.s.a. gestic and ulpp are registered trademarks of microchip technology germany ii gmbh & co. & kg, a subsidiary of microchip technology inc., in other countries. all other trademarks mentioned herein are property of their respective companies. ? 2011-2013, microchip technology incorporated, printed in the u.s.a., all rights reserved. printed on recycled paper. isbn: 978-1-62077-050-4 note the following details of the code protection feature on microchip devices: ? microchip products meet the specification contai ned in their particular microchip data sheet. ? microchip believes that its family of products is one of the most secure families of its kind on the market today, when used i n the intended manner and under normal conditions. ? there are dishonest and possibly illegal methods used to breach the code protection feature. all of these methods, to our knowledge, require using the microchip produc ts in a manner outside the operating specif ications contained in microchip?s data sheets. most likely, the person doing so is engaged in theft of intellectual property. ? microchip is willing to work with the customer who is concerned about the integrity of their code. ? neither microchip nor any other semiconduc tor manufacturer can guarantee the security of their code. code protection does not mean that we are guaranteeing the product as ?unbreakable.? code protection is constantly evolving. we at microchip are co mmitted to continuously improvin g the code protection features of our products. attempts to break microchip?s code protection feature may be a violation of the digital millennium copyright act. if such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that act. microchip received iso/ts-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in chandler and tempe, arizona; gresham, oregon and design centers in california and india. the company?s quality system processes and procedures are for its pic ? mcus and dspic ? dscs, k ee l oq ? code hopping devices, serial eeproms, microperipherals, nonvolatile memory and analog products. in addition, microchip?s quality system for the design and manufacture of development systems is iso 9001:2000 certified. quality management s ystem certified by dnv == iso/ts 16949 ==
ds70657g-page 526 . ? 2011-2013 microchip technology inc. americas corporate office 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7200 fax: 480-792-7277 technical support: http://www.microchip.com/ support web address: www.microchip.com atlanta duluth, ga tel: 678-957-9614 fax: 678-957-1455 boston westborough, ma tel: 774-760-0087 fax: 774-760-0088 chicago itasca, il tel: 630-285-0071 fax: 630-285-0075 cleveland independence, oh tel: 216-447-0464 fax: 216-447-0643 dallas addison, tx tel: 972-818-7423 fax: 972-818-2924 detroit farmington hills, mi tel: 248-538-2250 fax: 248-538-2260 indianapolis noblesville, in tel: 317-773-8323 fax: 317-773-5453 los angeles mission viejo, ca tel: 949-462-9523 fax: 949-462-9608 santa clara santa clara, ca tel: 408-961-6444 fax: 408-961-6445 toronto mississauga, ontario, canada tel: 905-673-0699 fax: 905-673-6509 asia/pacific asia pacific office suites 3707-14, 37th floor tower 6, the gateway harbour city, kowloon hong kong tel: 852-2401-1200 fax: 852-2401-3431 australia - sydney tel: 61-2-9868-6733 fax: 61-2-9868-6755 china - beijing tel: 86-10-8569-7000 fax: 86-10-8528-2104 china - chengdu tel: 86-28-8665-5511 fax: 86-28-8665-7889 china - chongqing tel: 86-23-8980-9588 fax: 86-23-8980-9500 china - hangzhou tel: 86-571-2819-3187 fax: 86-571-2819-3189 china - hong kong sar tel: 852-2943-5100 fax: 852-2401-3431 china - nanjing tel: 86-25-8473-2460 fax: 86-25-8473-2470 china - qingdao tel: 86-532-8502-7355 fax: 86-532-8502-7205 china - shanghai tel: 86-21-5407-5533 fax: 86-21-5407-5066 china - shenyang tel: 86-24-2334-2829 fax: 86-24-2334-2393 china - shenzhen tel: 86-755-8864-2200 fax: 86-755-8203-1760 china - wuhan tel: 86-27-5980-5300 fax: 86-27-5980-5118 china - xian tel: 86-29-8833-7252 fax: 86-29-8833-7256 china - xiamen tel: 86-592-2388138 fax: 86-592-2388130 china - zhuhai tel: 86-756-3210040 fax: 86-756-3210049 asia/pacific india - bangalore tel: 91-80-3090-4444 fax: 91-80-3090-4123 india - new delhi tel: 91-11-4160-8631 fax: 91-11-4160-8632 india - pune tel: 91-20-2566-1512 fax: 91-20-2566-1513 japan - osaka tel: 81-6-6152-7160 fax: 81-6-6152-9310 japan - tokyo tel: 81-3-6880- 3770 fax: 81-3-6880-3771 korea - daegu tel: 82-53-744-4301 fax: 82-53-744-4302 korea - seoul tel: 82-2-554-7200 fax: 82-2-558-5932 or 82-2-558-5934 malaysia - kuala lumpur tel: 60-3-6201-9857 fax: 60-3-6201-9859 malaysia - penang tel: 60-4-227-8870 fax: 60-4-227-4068 philippines - manila tel: 63-2-634-9065 fax: 63-2-634-9069 singapore tel: 65-6334-8870 fax: 65-6334-8850 taiwan - hsin chu tel: 886-3-5778-366 fax: 886-3-5770-955 taiwan - kaohsiung tel: 886-7-213-7828 fax: 886-7-330-9305 taiwan - taipei tel: 886-2-2508-8600 fax: 886-2-2508-0102 thailand - bangkok tel: 66-2-694-1351 fax: 66-2-694-1350 europe austria - wels tel: 43-7242-2244-39 fax: 43-7242-2244-393 denmark - copenhagen tel: 45-4450-2828 fax: 45-4485-2829 france - paris tel: 33-1-69-53-63-20 fax: 33-1-69-30-90-79 germany - munich tel: 49-89-627-144-0 fax: 49-89-627-144-44 italy - milan tel: 39-0331-742611 fax: 39-0331-466781 netherlands - drunen tel: 31-416-690399 fax: 31-416-690340 spain - madrid tel: 34-91-708-08-90 fax: 34-91-708-08-91 uk - wokingham tel: 44-118-921-5869 fax: 44-118-921-5820 worldwide sales and service 11/29/12


▲Up To Search▲   

 
Price & Availability of DSPIC33EP128MC504

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X